Skip to content

About

Terraform Provider for Fivetran

Resources

Contributing

Stars

45 stars

Watchers

45 watching

Forks

Repository files navigation

Fivetran

Manage your Fivetran resources as infrastructure as code.

Terraform Registry Latest Release License

Terraform Provider for Fivetran

The terraform-provider-fivetran is the official Terraform provider for managing Fivetran resources as infrastructure as code. Use it to provision and manage destinations, connections, users, teams, roles, and other Fivetran resources through version-controlled Terraform configurations.

We strongly encourage you to get acquainted with the Fivetran REST API documentation before using our Terraform provider.

See our CHANGELOG for information about the latest bug fixes, updates, and features added to the provider.

Quickstart

Prerequisites

Configure the provider

Create a Terraform configuration:

terraform {
  required_version = ">= 1.0"

  required_providers {
    fivetran = {
      source  = "fivetran/fivetran"
      version = "~> 1.9"
    }
  }
}

provider "fivetran" {}

resource "fivetran_group" "example" {
  name = "terraform-example"
}

Set your credentials as environment variables:

export FIVETRAN_APIKEY="your-api-key"
export FIVETRAN_APISECRET="your-api-secret"

Initialize Terraform and preview the configuration:

terraform init
terraform plan

Never commit API credentials to .tf files or version control. The provider requires the API key and API secret as separate values; do not use a Base64-encoded API key as either value. For authentication options and API-key types, see our Getting Started Guide.

Managing connections

Fivetran connection settings are service-specific. You can use the legacy fivetran_connector resource or the Connection_v2 Configuration Page to generate the required HCL for a connection service.

The fivetran_connection_v2 resource uses metadata-driven config and auth objects and validates their fields during planning. Keep these behaviors in mind:

  • destination_schema_names is required.
  • The accepted config and auth fields depend on the selected service.
  • Sensitive fields are not necessarily placed in auth; follow the generated configuration for the service.
  • New v2 connections are created paused. Manage their state separately with fivetran_connection_v2_pause_state.
  • fivetran_connection_v2 and fivetran_connection_v2_pause_state are in beta. Breaking changes to their schema aren't expected, but behavior may still change based on feedback before general availability.

See the fivetran_connection_v2 reference for the full resource schema.

Important considerations

  • Provider capabilities depend on the corresponding Fivetran REST API behavior and the selected connection service.
  • Some authorization flows, including interactive OAuth, may require completion outside Terraform.
  • Sensitive values may be stored in Terraform state. Use an encrypted remote backend with appropriately restricted access.
  • Avoid managing the same setting through overlapping Terraform resources or through both Terraform and the Fivetran dashboard. Out-of-band changes create drift and may be reverted by a later terraform apply.

For release-specific changes and known fixes, review the changelog before upgrading.

Known issues

  • Version 1.2.5 was broken, please use version 1.2.6.
  • Some lists may have to change to sets for better usability.
  • REST API's Response and Request payloads may differ for some connectors, and in some cases data transformations may occur. Setting up and managing some connectors may not be possible due to that limitation. As a workaround, we may deliver individual connectors data sources and resources at the Terraform Provider level instead of using the current REST API approach of a single endpoint to manage all connectors.
  • If you receive messages of the following type when planning/applying the fivetran_connector resource: unexpected new value: .config.field: was cty.StringVal("value"), but now null Or unexpected new value: .config.field: inconsistent values for sensitive attribute Check that the field causing the problem is actually applicable to the service specified in the resource
  • For SAP ERP for HANA connectors, configuring specific table selections via fivetran_connector_schema_config in Terraform may result in a Table with name [TABLE_NAME] not found in source schema [SCHEMA_NAME] error. This occurs because the SAP ERP for HANA connector initially starts with no schema preloaded, and a schema discovery process must complete successfully before tables can be configured. Even setting validation_level = "NONE" in Terraform does not resolve this underlying backend requirement. As a workaround, it is recommended to create the fivetran_connector resource without the fivetran_connector_schema_config resource first. Allow the connector to be created and initiate its schema discovery. After the connector is established and the schema has been discovered (which may require a manual refresh in the Fivetran UI or an API call), then manage table selections and schema configurations directly within the Fivetran UI.

Support

For feedback, feature requests, or bug reports, contact Fivetran through the Support Portal.

Contributions

External contributions are not currently accepted. See CONTRIBUTING.md for the current contribution policy.

License

This project is licensed under the Apache License 2.0.

About

Terraform Provider for Fivetran

Resources

Contributing

Stars

45 stars

Watchers

45 watching

Forks

Releases

Packages

Used by

Contributors

Languages