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.
Production system resources
Once you deploy your custom connector to our production infrastructure, we run it on a 64-bit Linux (amd64) platform with 4 GB of RAM.
Our production infrastructure allows for some variation in resources available to your connections at any given moment, load balancing across multiple connections. Stream or batch source data instead of accumulating the complete dataset in memory.
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.
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 Beta
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.
Configure deployment settings
Before deploying your connector, gather the following deployment information.
| Value | Description |
|---|---|
| API key | Base64-encoded Fivetran API key and secret in {api_key}:{api_secret} format. |
| Destination name | The destination name as displayed on the Destinations page in the Fivetran dashboard. |
| Connection name | The name of the connection to create or update. Must begin with a lowercase letter (a-z) or underscore (_) and contain only lowercase letters, numbers, and underscores. |
| Configuration path | Path to the configuration JSON file. Required when creating a connection. Can be omitted when updating an existing one. |
| Python version | Python minor version for the connector runtime. Defaults to Python 3.14 for new connections. Required when you update an existing connection. |
| Naming strategy | How source identifiers map to destination identifiers. See Choose a naming strategy. Defaults to FIVETRAN. |
| Hybrid Deployment Agent ID | ID of a Hybrid Deployment agent. Required when you update an existing connection in a Hybrid Deployment destination, including when it uses the destination's default agent. For new connections, the destination's default agent is used if you don't specify one. |
| Proxy Agent ID | Proxy Agent ID. |
| Proxy host config key | Key in configuration.json that contains the host:port endpoint. Only valid with a Proxy Agent ID. |
Once you have these values, choose how to provide them to fivetran deploy:
- CLI flags: Pass values directly on the command line. Use this for one-off deployments or when values vary per run. This requires no prior setup.
- Environment variables: Export values in your shell or CI/CD system. Use this to avoid repeating values across runs and to keep secrets out of files.
- Deployment options file: Starting with
fivetran-connector-sdkv3.0.0, you can also store values in a local file and organize settings for multiple connections into named profiles. Use this when you regularly deploy to more than one connection or environment. This file requires Python 3.11 or later.
When a setting is provided through more than one method, the CLI uses the value from the highest-priority source: CLI flags take precedence, followed by environment variables, the deployment options file, and finally the built-in default. For details, see Field resolution order.
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.
With fivetran run, the naming strategy is locked to the namespace in the catalog. To test a different strategy, use a different namespace.
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.jsonanddestination.json(whichfivetran runreads) from 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.
For the full list of flags and examples, see the fivetran deploy reference.
If environment variables provide all required settings, run fivetran deploy with no additional flags. If you use a deployment options file, provide the API key separately through FIVETRAN_API_KEY or --api-key, and select a named profile with --profile <profile_name> unless your settings are in [default].
To update an existing connection, see how to redeploy a connection.
Option 2: 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 our Create Git CI/CD Deployment Pipeline documentation for an example implementation.
Option 3: 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.jsonanddestination.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.
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.
Performance profiling
Performance profiling is automatically enabled for all connections, apart from connections hosted on Hybrid Deployment. You can access generated flamegraphs in your Fivetran dashboard. For more information, see our Production performance profiling documentation.