Deploying Connectors
Deploy your Connector SDK custom connector to Fivetran to create a connection or update an existing one. You can deploy from the Connector SDK command-line interface (CLI), automate deployments in a CI/CD pipeline, or create and upload a connector package using the Fivetran REST API.
The following sections describe the full connector deployment lifecycle:
- What to do before deploying a connector
- How to deploy a Connector SDK connector
- What to do after deploying a connector
Prerequisites
Make sure you have the following:
- A Fivetran account and a destination where the connection will deliver data.
- A Fivetran API key with permission to create or update the connection. The CLI expects a Base64-encoded value in the format
{api_key}:{api_secret}. - A supported Python version. If you do not explicitly select a version during deployment, the deployment uses the default version.
Before you deploy your connector
We suggest centralizing deployment in a code deployment system. Connector SDK is a command-line tool that works with standard continuous integration and deployment tools.
Choose deployment model
Connector SDK supports both deployment models Fivetran offers:
- SaaS Deployment: Fivetran runs the connector code in an isolated, Fivetran-managed runtime in the cloud and region associated with the destination.
- Hybrid Deployment: Fivetran runs the connector using a Hybrid Deployment Agent in your environment. Hybrid Deployment requires an Enterprise or Business Critical plan.
When you deploy to a destination configured for Hybrid Deployment, the connection uses that destination's default agent. To use another available agent, pass its ID with --hybrid-deployment-agent-id.
For a SaaS-deployed connector, the production runtime is 64-bit Linux on amd64 with 4 GB of RAM. Stream or batch source data instead of accumulating the complete dataset in memory.
The deployed Connector SDK runtime must be able to reach the source. Connector SDK supports the following network connection options:
- Direct access by safelisting Fivetran IP addresses
- SSH tunnel
- Reverse SSH tunnel
- VPN tunnel
- AWS PrivateLink
- Azure Private Link
- Google Cloud Private Service Connect
- Proxy Agent Private Preview
Some networking options require a specific Fivetran plan or coordination with Fivetran. Configure and validate networking before starting the first sync in production.
Prepare the connector project
See our Recommended Project Structure documentation for more information on the typical structure for your project and the recommended guidelines. You must run the deployment command from the connector project's root directory.
Fivetran installs the declared dependencies before running the connector. Test dependency installation using the same Python version you plan to use in production.
Prepare configuration values
Use a JSON configuration file to provide source credentials and runtime settings during the initial deployment. The file is commonly named configuration.json, but you can use another name.
Example:
{
"api_key": "replace_with_source_api_key",
"base_url": "https://api.example.com",
"page_size": "100"
}
For configuration requirements, behavior, and how the configuration is resolved, see our configuration.json documentation.
Validate the connector before deployment
Do not use deployment as the first end-to-end test. Test your connector locally:
fivetran debug --configuration configuration.json
The local tester creates the following files in the project's files directory:
warehouse.db: A DuckDB database that represents the data the connector sends to a destination.state.json: The state saved by the connector's checkpoint operations.
See our Testing and Performance Optimization documentation to learn more about testing your custom connector before deploying it.
Before deployment, verify that:
- The connector can authenticate and retrieve data from the source.
- Tables, columns, data types, primary keys, and system-column behavior are correct. See our Data Extraction and Handling documentation for more information.
- The initial sync works when the connector receives an empty state object.
- A second run retrieves only the expected new or changed records.
- Deletes or full-refresh behavior work as intended.
- State advances only after data is safe to commit. See our State Management documentation for more information.
- The connector checkpoints at suitable batch or page boundaries.
- Source pagination has deterministic ordering and does not skip records with duplicate cursor values.
- Memory usage remains below the production limit. See our Connector Memory Management documentation for more information.
- Logs are useful and do not expose credentials or sensitive source data. See our Connector SDK Logs documentation for more information.
To test another initial sync, reset local state and destination data:
fivetran reset fivetran debug --configuration configuration.json
fivetran reset deletes the local files/state.json and files/warehouse.db files. It does not affect a deployed connection.
Gather deployment values
You need the following values for a CLI deployment:
| Value | Description |
|---|---|
| API key | Base64-encoded Fivetran API key and secret. |
| Destination name | The destination name displayed on the Destinations page in the Fivetran dashboard. |
| Connection name | The name of the connection to create or update. The connection name must begin with a lowercase letter (a-z) or underscore (_) and must contain only lowercase letters, numbers, and underscores after the first character. |
| Configuration path | Required when creating a connection. It may be omitted when updating an existing connection. |
Choose a naming strategy
The --naming option determines how source identifiers become destination identifiers:
FIVETRAN: Applies Fivetran naming transformations. This is the default.SOURCE: Preserves source table and column names, including supported UTF-8 characters.
The naming strategy is applied only when the connection is created. A later redeployment cannot change it; the CLI ignores a new value and displays a warning.
Test locally with the same naming strategy you will use in production:
fivetran debug --naming SOURCE --configuration configuration.json fivetran deploy --naming SOURCE <other_options>
The local tester stores the naming strategy in warehouse.db. Run fivetran reset before testing another strategy.
How to deploy a connector
Option 1: Deploy using the CLI
From the project root, run:
fivetran deploy --api-key <YOUR_BASE64_API_KEY> --destination <YOUR_DESTINATION_NAME> --connection <YOUR_CONNECTION_NAME> --configuration <PATH_TO_CONFIGURATION_JSON>
Example:
fivetran deploy --api-key $FIVETRAN_API_KEY --destination production_snowflake --connection custom_orders --configuration configuration.json --python 3.13
When deploying a new connection, fivetran deploy:
- Packages the connector project.
- Excludes
configuration.jsonfrom the code package. - Uploads the package and configuration values separately.
- Creates the Connector SDK connection in the selected destination.
- Configures the selected Python version, naming strategy, and deployment model.
- Returns the connection ID and a link to the connection in the Fivetran dashboard.
Deployment-related CLI options
| Option | Description |
|---|---|
--api-key | Base64-encoded Fivetran API key. Required unless FIVETRAN_API_KEY is set. |
--destination | Destination name. Required unless FIVETRAN_DESTINATION_NAME is set. |
--connection | Connection name. Required unless FIVETRAN_CONNECTION_NAME is set. |
--configuration | Path to the configuration JSON file. |
--python or --python-version | Supported Python minor version. Defaults to Python 3.14. |
--hybrid-deployment-agent-id | Hybrid Deployment Agent to use instead of the destination's default agent. |
--naming | FIVETRAN or SOURCE naming strategy for a new connection. Defaults to FIVETRAN. |
--yes | Answers Yes to confirmation prompts, including the overwrite prompt for an existing connection. |
--non-interactive | Uses the default answer for each prompt. It does not supply missing values and does not confirm an overwrite whose default is No. |
<project path> | Optional absolute or relative project directory. The current directory is used when omitted. |
To update an existing connection, see how to redeploy a connection.
Environment variables
Set deployment values as environment variables to avoid passing them on every command:
export FIVETRAN_API_KEY="<base64_encoded_api_key>"
export FIVETRAN_DESTINATION_NAME="production_snowflake"
export FIVETRAN_CONNECTION_NAME="custom_orders"
export FIVETRAN_CONFIGURATION="configuration.json"
Then run fivetran deploy with no flags.
Do not store secrets in shell scripts or repository files. Use the secret-management facility provided by your local environment or CI/CD system. See Working with Environment Variables for more information.
Option 2: Deploy using a package and the REST API
Use the REST API deployment route for programmatic workflows, multi-stage release pipelines, or Powered by Fivetran integrations where you need explicit control over package artifacts and connection creation as separate steps.
To create a Connector SDK connection through the REST API:
- Create the connector ZIP with
fivetran package. The command createsfiles/<project_name>.zip, validates the dependency file, respects.gitignore, and excludesconfiguration.json. - Upload the ZIP using the Create Connector SDK Package endpoint. Each package can only be associated with one connection at a time.
- Record the returned
package_id. - Call the standard Create a Connection endpoint with the
package_idin the connector configuration and the required credentials insecrets_list. - Configure and start the connection using the normal Connection resource endpoints.
Option 3: Automate deployment with CI/CD
We recommend deploying from a centralized pipeline for production connectors.
A deployment pipeline should:
- Check out a reviewed connector revision.
- Set up a supported Python version.
- Install Connector SDK and project dependencies.
- Run automated tests and
fivetran debugagainst controlled test data when practical. - Create a temporary configuration file from protected secrets, or omit configuration for code-only redeployments.
- Deploy with
--yesso an intentional update does not stop at the overwrite prompt. - Remove temporary secret files after deployment.
- Record the deployed commit, SDK version, Python version, target connection, and deployment result.
Example deployment step:
- name: Deploy Connector SDK connection
env:
FIVETRAN_API_KEY: ${{ secrets.FIVETRAN_API_KEY }}
FIVETRAN_DESTINATION_NAME: ${{ secrets.FIVETRAN_DESTINATION_NAME }}
FIVETRAN_CONNECTION_NAME: ${{ secrets.FIVETRAN_CONNECTION_NAME }}
run: fivetran deploy --python 3.13 --yes
If the pipeline creates configuration.json, ensure that it is temporary, excluded from build artifacts, and populated only from protected secrets. Remember that deploying non-empty configuration replaces the stored connection configuration.
See Create Git CI/CD Pipeline for an example implementation.
After you deploy a connector
The new connection is paused by default. Deployment uploads the code but does not prove that the production runtime can retrieve and sync the complete source data. Your next step is to start and verify the initial sync in production.
Start and verify the initial sync
After deployment, start and verify the initial sync:
- Open the connection using the URL returned by the CLI, or find it on the Connections page in the Fivetran dashboard.
- Review the connection's configuration and schema settings.
- Start the initial sync by clicking Start Initial Sync, clicking Sync Now, or enabling the connection.
- Alternatively, use the Fivetran REST API to unpause or trigger the connection.
- Monitor the Connector SDK logs and the connection status until the sync succeeds.
- Validate destination tables, row counts, primary-key behavior, deletes, timestamps, and cursor boundaries against the source.
- Run at least one subsequent incremental sync and confirm that the connector does not repeat or skip data.
Check production logs
You can access production logs in one of the following ways:
- The Connector SDK logs tab on the connection details page
- The
CONNECTOR_SDK_LOGtable delivered by the Fivetran Platform Connector - A configured external logging service
Connector code logs are prefixed with sdk; Fivetran runtime and delivery logs are prefixed with platform.