### Get all Quickstart packages metadata Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/quickstart_packages.md Use this data source to retrieve metadata for all available Quickstart transformation packages. No configuration is required. ```hcl data "fivetran_quickstart_packages" "all_packages_metadata" { } ``` -------------------------------- ### Quickstart Transformation Example Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/transformation.md Configure a Quickstart transformation using this snippet. It requires a package name, connection IDs, and optionally excluded models. ```hcl resource "fivetran_transformation" "transformation" { provider = fivetran-provider type = "QUICKSTART" paused = true schedule { schedule_type = "TIME_OF_DAY" time_of_day = "11:00" } transformation_config { package_name = "package_name" connection_ids = ["connection_id1", "connection_id2"] excluded_models = ["excluded_model1", "excluded_model2"] } } ``` -------------------------------- ### Quickstart Package Data Source Example Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/quickstart_package.md Use the `fivetran_quickstart_package` data source to retrieve metadata for a Quickstart transformation package by its ID. ```hcl data "fivetran_quickstart_package" "test" { id = "id" } ``` -------------------------------- ### Example Usage of fivetran_transformations Data Source Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/transformations.md This snippet demonstrates how to use the `fivetran_transformations` data source to fetch transformation details. No specific setup or imports are required beyond the standard Terraform configuration. ```hcl data "fivetran_transformations" "test" { } ``` -------------------------------- ### fivetran_quickstart_package Data Source Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/quickstart_package.md Use the `fivetran_quickstart_package` data source to retrieve metadata for a specific Quickstart transformation package. You need to provide the package's unique identifier. ```APIDOC ## Data Source: fivetran_quickstart_package ### Description This data source returns the metadata details of the Quickstart transformation package if a valid identifier is provided. ### Usage ```hcl data "fivetran_quickstart_package" "test" { id = "id" } ``` ### Parameters #### Required - **id** (String) - The unique identifier for the Quickstart transformation package definition within the Fivetran system. ### Read-Only Attributes - **configurable_variables** (Attributes Map) - Map of configurable variable definitions for the package, keyed by variable name. - **allowed_values** (List of String) - List of allowed values for the variable, if restricted. - **description** (String) - Human-readable description of the variable. - **type** (String) - The variable type (e.g. STRING, INTEGER, BOOLEAN, DATE). - **connector_types** (Set of String) - The set of connector types. - **name** (String) - The Quickstart transformation package name. - **output_model_names** (Set of String) - The list of transformation output models. - **version** (String) - The Quickstart package definition version. ``` -------------------------------- ### JSON Schema Configuration Example Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/guides/schema_json.md Defines schema settings for a Fivetran connector, including table and column configurations. Ensure the 'enabled' field is a boolean. ```json { "schema_0": { "enabled": true, "some_random_extra_field": "extra_value", "tables": { "table_0": { "some_random_extra_field": "extra_value", "enabled": true }, ... } }, "schema_2": { "enabled": true, "some_random_extra_field": "extra_value", "tables": { "table_0": { "some_random_extra_field": "extra_value", "enabled": true, "columns": { "column_1": { "enabled": false } } }, ... } }, ... } ``` -------------------------------- ### Create a Fivetran Connector Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/connector.md This example demonstrates how to create a new Fivetran connector, specifying its group, service, destination schema, and configuration details. The connector is created in a paused state. ```hcl resource "fivetran_connector" "amplitude" { group_id = fivetran_group.group.id service = "amplitude" destination_schema { name = "amplitude_connector" } config { project_credentials { project = "project1" api_key = "my_api_key" secret_key = "my_secret_key" } project_credentials { project = "project2" api_key = "my_api_key" secret_key = "my_secret_key" } } } ``` -------------------------------- ### Configure S3 Connection with Auth Only Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/connection_config.md Shows an example where only the auth block is required for the connection. ```hcl resource "fivetran_connection" "s3" { group_id = fivetran_group.example.id service = "s3" destination_schema { name = "s3_data" } } resource "fivetran_connection_config" "s3" { connection_id = fivetran_connection.s3.id auth = jsonencode({ role_arn = "arn:aws:iam::123456789:role/fivetran-access" }) run_setup_tests = true } ``` -------------------------------- ### dbt Core Transformation Example Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/transformation.md Use this snippet to configure a dbt Core transformation. It specifies the project ID, name, and steps involved in the transformation process. ```hcl resource "fivetran_transformation" "transformation" { provider = fivetran-provider type = "DBT_CORE" paused = true schedule { schedule_type = "TIME_OF_DAY" time_of_day = "11:00" } transformation_config { project_id = "project_id" name = "name" steps = [ { name = "name1" command = "command1" }, { name = "name2" command = "command2" } ] } } ``` -------------------------------- ### fivetran_connector Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/connector.md Creates a new Fivetran connector. The connector is created in a paused state. Data syncs can be started by creating a corresponding fivetran_connector_schedule resource with `paused = false`. ```APIDOC ## Resource: fivetran_connector ### Description This resource allows you to create, update, and delete connectors in Fivetran. By default, connectors are created in a paused state. To initiate data synchronization, a `fivetran_connector_schedule` resource must be created with `paused = false`. ### Schema #### Required - **group_id** (String) - The unique identifier for the Group (Destination) within the Fivetran system. - **service** (String) - The connector type ID within the Fivetran system. #### Optional - **auth** (Block) - Configuration block for authentication. (see [below for nested schema](#nestedblock--auth)) - **config** (Block) - Configuration block for connector-specific settings. (see [below for nested schema](#nestedblock--config)) - **data_delay_sensitivity** (String) - The level of data delay notification threshold. Possible values: LOW, NORMAL, HIGH, CUSTOM. The default value is NORMAL. CUSTOM is only available for customers using the Enterprise plan or above. - **data_delay_threshold** (Number) - Custom sync delay notification threshold in minutes. The default value is 0. This parameter is only used when `data_delay_sensitivity` is set to CUSTOM. - **destination_schema** (Block) - Configuration block for connector schema settings. (see [below for nested schema](#nestedblock--destination_schema)) - **hybrid_deployment_agent_id** (String) - The hybrid deployment agent ID that refers to the controller created for the group the connection belongs to. If the value is specified, the system will try to associate the connection with an existing agent. - **networking_method** (String) - Specifies the networking method for the connector. Possible values: Directly, SshTunnel, ProxyAgent, PrivateLink. - **private_link_id** (String) - The private link ID. - **proxy_agent_id** (String) - The proxy agent ID. - **run_setup_tests** (Boolean) - Specifies whether the setup tests should be run automatically. The default value is FALSE. - **timeouts** (Block) - Configuration block for resource timeouts. (see [below for nested schema](#nestedblock--timeouts)) - **trust_certificates** (Boolean) - Specifies whether to automatically trust certificates. The default value is FALSE. If a certificate is not trusted automatically, it must be approved using the Certificates Management API. - **trust_fingerprints** (Boolean) - Specifies whether to automatically trust SSH fingerprints. The default value is FALSE. If a fingerprint is not trusted automatically, it must be approved using the Certificates Management API. ### Nested Schemas #### `auth` (see [below for nested schema](#nestedblock--auth)) #### `config` (see [below for nested schema](#nestedblock--config)) #### `destination_schema` (see [below for nested schema](#nestedblock--destination_schema)) #### `timeouts` (see [below for nested schema](#nestedblock--timeouts)) ``` -------------------------------- ### Get Fivetran Connector Details Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/connector.md Use this snippet to retrieve a specific Fivetran connector by its ID. Ensure you have the connector's unique identifier. ```hcl data "fivetran_connector" "connector" { id = "anonymous_mystery" } ``` -------------------------------- ### config.secrets_list Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/connector.md Read-only nested schema for secrets list, used for storing sensitive information like keys and values. The specific key and value fields are dependent on the service, with examples for AWS Lambda, Azure Function, Connector SDK, and Google Cloud Function. ```APIDOC ## Nested Schema for `config.secrets_list` ### Description Read-only nested schema for secrets list, used for storing sensitive information like keys and values. The specific key and value fields are dependent on the service, with examples for AWS Lambda, Azure Function, Connector SDK, and Google Cloud Function. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - `key` (String) - Field usage depends on `service` value: Service `aws_lambda`: Secret Key. Service `azure_function`: Key. Service `connector_sdk`: Key. Service `google_cloud_function`: Key. - `value` (String, Sensitive) - Field usage depends on `service` value: Service `aws_lambda`: Secret Value. Service `azure_function`: Value. Service `connector_sdk`: Value. Service `google_cloud_function`: Value. ``` -------------------------------- ### Create PostgreSQL Connection with Full Configuration Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/connection.md This example demonstrates creating a PostgreSQL connection with comprehensive configuration details, including host, port, database, and user, alongside the service type and destination schema. ```hcl resource "fivetran_connection" "postgres_full" { group_id = fivetran_group.example.id service = "postgres" destination_schema { prefix = "my_postgres" } config = jsonencode({ update_method = "XMIN" host = local.database_config.host port = 5432 database = "mydb" user = "fivetran_user" }) run_setup_tests = false } ``` -------------------------------- ### GET /v1/transformation-projects Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/transformation_project.md Retrieves a list of all transformation projects available in the account. ```APIDOC ## GET /v1/transformation-projects ### Description Retrieves a list of all transformation projects to identify the Transformation Project ID for management or import. ### Method GET ### Endpoint https://api.fivetran.com/v1/transformation-projects ``` -------------------------------- ### GET /v1/transformation-projects/{project-id} Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/transformation_project.md Retrieves the details of a specific transformation project by its ID. ```APIDOC ## GET /v1/transformation-projects/{project-id} ### Description Fetches detailed configuration and status information for a specific transformation project. ### Method GET ### Endpoint https://api.fivetran.com/v1/transformation-projects/{project-id} ### Parameters #### Path Parameters - **project-id** (String) - Required - The unique identifier for the transformation project. ``` -------------------------------- ### Example Usage of fivetran_connector_sdk_package Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/connector_sdk_package.md This snippet demonstrates how to define a fivetran_connector_sdk_package resource and reference its ID in a fivetran_connector resource. Ensure the file_path points to your connector's .zip archive. ```hcl resource "fivetran_connector_sdk_package" "example_package" { provider = fivetran-provider file_path = "${path.module}/weather.zip" } resource "fivetran_connector" "example_connector" { provider = fivetran-provider service = "connector_sdk" group_id = fivetran_group.group.id destination_schema { name = "my_schema" } config { package_id = fivetran_connector_sdk_package.example_package.id python_version = "3.13" secrets_list { key = "api_key" value = "secret123" } } run_setup_tests = false } ``` -------------------------------- ### GET fivetran_connectors Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/connectors.md Retrieves a list of connector objects based on the provided ID. ```APIDOC ## GET fivetran_connectors ### Description This data source returns a list of connector objects associated with the Fivetran account. ### Parameters #### Request Body - **id** (String) - Required - The ID of this resource. ### Response #### Success Response (200) - **connectors** (Block Set) - List of connector objects. - **id** (String) - The ID of this resource. ### Nested Schema for `connectors` - **connected_by** (String) - The unique identifier of the user who created the connector. - **created_at** (String) - The timestamp of when the connector was created. - **daily_sync_time** (String) - The sync start time. - **data_delay_sensitivity** (String) - The level of data delay notification threshold. - **data_delay_threshold** (Number) - Custom sync delay notification threshold in minutes. - **failed_at** (String) - The timestamp of the last failed sync. - **group_id** (String) - The unique identifier for the Group (Destination). - **hybrid_deployment_agent_id** (String) - The hybrid deployment agent ID. - **id** (String) - The unique identifier for the connector. - **name** (String) - The name of the connector. - **networking_method** (String) - The networking method used (Directly, SshTunnel, ProxyAgent, PrivateLink). - **pause_after_trial** (Boolean) - Whether the connector pauses after the free trial. - **paused** (Boolean) - Whether the connector is paused. - **private_link_id** (String) - The private link ID. - **proxy_agent_id** (String) - The proxy agent ID. - **schedule_type** (String) - The connector schedule configuration type. - **service** (String) - The connector type id. - **service_version** (String) - The connector type version. - **succeeded_at** (String) - The timestamp of the last successful sync. - **sync_frequency** (Number) - The connector sync frequency in minutes. ``` -------------------------------- ### Configure Fivetran Transformation Project with Private Git Repo Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/guides/transformation_private_git_deploy_key.md Use this resource to set up a DBT_GIT transformation project. Ensure the `public_key` is used to configure a deploy key in your Git repository. Setting `run_tests` to `false` will prevent test failures from halting the Terraform plan. ```hcl resource "fivetran_group" "my_group" { name = "My_Group" } resource "fivetran_transformation_project" "project" { provider = fivetran-provider group_id = fivetran_group.my_group.id type = "DBT_GIT" run_tests = false project_config { git_remote_url = "git_remote_url" git_branch = "git_branch" folder_path = "folder_path" dbt_version = "dbt_version" default_schema = "default_schema" threads = 0 target_name = "target_name" environment_vars = ["environment_var"] } lifecycle { action_trigger { action = fivetran_transformation_project_run_tests.project_tests events = ["after_update"] } } } ``` -------------------------------- ### Create a Fivetran group Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/guides/connector_setup.md Define a group resource to serve as the root for infrastructure setup. ```hcl resource "fivetran_group" "group" { name = "MyGroup" } ``` -------------------------------- ### Apply Terraform configuration Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/guides/connector_setup.md Execute the Terraform apply command to provision the defined resources. ```bash terraform apply ``` -------------------------------- ### GET /fivetran_group_connectors Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/group_connectors.md Retrieves a list of connectors for a specified group. Supports filtering by schema name. ```APIDOC ## GET /fivetran_group_connectors ### Description Retrieves a list of information about all connectors within a group in your Fivetran account. ### Parameters #### Request Body - **id** (String) - Required - The ID of the group. - **schema** (String) - Optional - Filter to return information only for the connector with the specified schema name. ### Response #### Success Response (200) - **connectors** (Block Set) - A list of connectors associated with the group. #### Nested Schema for connectors - **connected_by** (String) - The unique identifier of the user who created the connector. - **created_at** (String) - The timestamp of when the connector was created. - **daily_sync_time** (String) - The optional parameter that defines the sync start time. - **failed_at** (String) - The timestamp of the last failed sync. - **group_id** (String) - The unique identifier for the Group. - **id** (String) - The unique identifier for the Connector. - **schedule_type** (String) - The connector schedule configuration type (auto, manual). - **schema** (String) - The name of the connector/schema. - **service** (String) - The connector type name. - **service_version** (Number) - The connector type version. - **status** (Block) - The current status of the connector. - **succeeded_at** (String) - The timestamp of the last successful sync. - **sync_frequency** (Number) - The connector sync frequency in minutes. ``` -------------------------------- ### GET fivetran_connections Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/connections.md Retrieves a list of Fivetran connection objects based on optional filter criteria. ```APIDOC ## GET fivetran_connections ### Description Retrieves a list of connection objects. Can be filtered by group_id or schema_name. ### Parameters #### Query Parameters - **group_id** (String) - Optional - The ID of the group (destination) to filter connections by. - **schema_name** (String) - Optional - The name used both as the connection's name within the Fivetran system and as the source schema's name within your destination. ### Response #### Success Response (200) - **connections** (Block Set) - List of connection objects. - **id** (String) - The ID of this resource. #### Nested Schema for connections - **connected_by** (String) - The unique identifier of the user who has created the connection. - **created_at** (String) - The timestamp of the time the connection was created. - **daily_sync_time** (String) - The optional parameter that defines the sync start time. - **data_delay_sensitivity** (String) - The level of data delay notification threshold. - **data_delay_threshold** (Number) - Custom sync delay notification threshold in minutes. - **failed_at** (String) - The timestamp of the time the connection sync failed last time. - **group_id** (String) - The unique identifier for the Group (Destination). - **hybrid_deployment_agent_id** (String) - The hybrid deployment agent ID. - **id** (String) - The unique identifier for the connection. - **name** (String) - The name of the connection. - **networking_method** (String) - The networking method (Directly, SshTunnel, ProxyAgent, PrivateLink). - **pause_after_trial** (Boolean) - Specifies whether the connection should be paused after the free trial. - **paused** (Boolean) - Specifies whether the connection is paused. - **private_link_id** (String) - The private link ID. - **proxy_agent_id** (String) - The ID of the proxy agent. - **schedule_type** (String) - The connection schedule configuration type (auto, manual). - **service** (String) - The connection service type. - **service_version** (String) - The connection type version. - **succeeded_at** (String) - The timestamp of the time the connection sync succeeded last time. - **sync_frequency** (Number) - The connection sync frequency in minutes. ``` -------------------------------- ### Data Source: fivetran_external_logs Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/external_logs.md Example usage of the fivetran_external_logs data source to retrieve logging service information. ```APIDOC ## Data Source: fivetran_external_logs ### Description This data source returns a list of logging service objects. ### Method GET ### Endpoint /fivetran/external_logs ### Parameters #### Query Parameters - **id** (String) - Required - The ID of this resource. ### Request Example ```hcl data "fivetran_external_logs" "extlog" { id = "anonymous_mystery" } ``` ### Response #### Success Response (200) - **id** (String) - The ID of this resource. - **logs** (Block Set) - A list of logging service configurations. - **enabled** (Boolean) - The boolean value specifying whether the log service is enabled. - **id** (String) - The unique identifier for the log service within the Fivetran system. - **service** (String) - The name for the log service type within the Fivetran system. We support the following log services: azure_monitor_log, cloudwatch, datadog_log, new_relic_log, splunkLog, stackdriver. #### Response Example ```json { "id": "anonymous_mystery", "logs": [ { "enabled": true, "id": "log_service_1", "service": "cloudwatch" }, { "enabled": false, "id": "log_service_2", "service": "datadog_log" } ] } ``` ``` -------------------------------- ### Define fivetran_connector resource Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/guides/schema_setup.md Initializes a connector resource. Setting run_setup_tests to true is required for authorization. ```hcl resource "fivetran_connector" "connector" { ... run_setup_tests = "true" # it is necessary to authorise connector } ``` -------------------------------- ### Get Fivetran Users Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/users.md Use this data source to retrieve a list of all users in your Fivetran account. No specific configuration is required. ```hcl data "fivetran_users" "users" { } ``` -------------------------------- ### Get Fivetran Team by ID Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/data-sources/team.md Use this data source to retrieve information about a Fivetran team by providing its unique identifier. ```hcl data "fivetran_team" "team" { id = "team_id" } ``` -------------------------------- ### Configure MySQL Connection with Config Only Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/connection_config.md Demonstrates a configuration where credentials are included directly within the config block. ```hcl resource "fivetran_connection" "mysql" { group_id = fivetran_group.example.id service = "mysql" destination_schema { prefix = "my_mysql" } } resource "fivetran_connection_config" "mysql" { connection_id = fivetran_connection.mysql.id config = jsonencode({ update_method = "BINLOG" host = "mysql.example.com" port = 3306 database = "mydb" user = "fivetran_user" password = var.mysql_password }) run_setup_tests = true } ``` -------------------------------- ### Importing an existing fivetran_connector_sdk_package Source: https://github.com/fivetran/terraform-provider-fivetran/blob/main/docs/resources/connector_sdk_package.md This example shows how to import an existing fivetran_connector_sdk_package resource into your Terraform state. You will need the package ID from the Fivetran UI or API and must manually provide the local file_path after import. ```hcl resource "fivetran_connector_sdk_package" "my_imported_sdk_package" { } ```