### Example Download Provider Binaries Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md An example of downloading provider binaries using a specific run ID. ```bash gh run download 21702397923 --name provider_binaries --dir ./provider-bin ``` -------------------------------- ### Copy Environment Example Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Copy the example environment file to .env for local configuration. ```bash cp .env.example .env ``` -------------------------------- ### Add or Edit a Guide Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/CONTRIBUTING.md To add or edit a guide, create or modify a .md.tmpl file in 'templates/guides/', regenerate the docs, and then commit both the template and the generated output. ```bash git add templates/guides/my_guide.md.tmpl docs/guides/my_guide.md git commit -m "docs: add my_guide" ``` -------------------------------- ### airbyte_connections Data Source Example Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/connections.md Example of how to use the airbyte_connections data source to retrieve connection information. It demonstrates filtering by deleted status, setting limits and offsets, and specifying tag and workspace IDs. ```terraform data "airbyte_connections" "my_connections" { include_deleted = false limit = 20 offset = 0 tag_ids = [ "05db8e59-424e-49ea-80ce-1db6a74f3dfc" ] workspace_ids = [ "a31bb8f4-e5b5-4dc9-bf1e-872e426f3223" ] } ``` -------------------------------- ### Running the Airbyte Terraform Provider Example Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/USAGE.md This snippet shows how to run the main Go program for the Airbyte Terraform provider and then apply a Terraform configuration. It includes steps for debugging and reattaching Terraform providers. ```shell go run main.go --debug # Copy the TF_REATTACH_PROVIDERS env var # In a new terminal cd examples/your-example TF_REATTACH_PROVIDERS=... terraform init TF_REATTACH_PROVIDERS=... terraform apply ``` -------------------------------- ### Declarative Source Definition Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/declarative_source_definition.md Example of how to create a declarative source definition. Requires a valid low-code CDK manifest, a name, and the workspace ID. ```terraform resource "airbyte_declarative_source_definition" "my_declarativesourcedefinition" { manifest = "{ \"see\": \"documentation\" }" name = "...my_name..." workspace_id = "e5279006-d3bf-4277-ada7-423cb18aaece" } ``` -------------------------------- ### Import an airbyte_source_definition resource using terraform import command Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source_definition.md This example demonstrates how to import an existing source definition using the `terraform import` command. This method is an alternative to using the `import` block and requires specifying the resource ID and workspace ID in a JSON format. ```shell terraform import airbyte_source_definition.my_airbyte_source_definition '{"id": "...", "workspace_id": "..."}' ``` -------------------------------- ### Declarative Source Definition Example Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/declarative_source_definition.md Example usage of the airbyte_declarative_source_definition data source to retrieve details of a specific source definition. ```terraform data "airbyte_declarative_source_definition" "my_declarativesourcedefinition" { id = "...my_id..." workspace_id = "e5279006-d3bf-4277-ada7-423cb18aaece" } ``` -------------------------------- ### Get airbyte_connection Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/connection.md Example of how to retrieve an existing Airbyte connection using its ID. ```terraform data "airbyte_connection" "my_connection" { connection_id = "...my_connection_id..." } ``` -------------------------------- ### Import an airbyte_source_definition resource Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source_definition.md This example shows how to import an existing source definition into your Terraform state using the `import` block. This is useful for managing resources that were not initially created by Terraform. ```terraform import { to = airbyte_source_definition.my_airbyte_source_definition id = jsonencode({ id = "..." workspace_id = "..." }) } ``` -------------------------------- ### airbyte_connection Resource Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/connection.md Example of how to configure an airbyte_connection resource with detailed stream configurations, including mappers, selected fields, and sync modes. This snippet demonstrates setting up a connection with specific data residency, source and destination IDs, and scheduling. ```terraform resource "airbyte_connection" "my_connection" { configurations = { streams = [ { cursor_field = [ "..." ] destination_object_name = "...my_destination_object_name..." include_files = false mappers = [ { id = "6563d1b7-013b-4974-a129-ba463c808f28" mapper_configuration = { encryption = { aes = { algorithm = "AES" field_name_suffix = "...my_field_name_suffix..." key = "...my_key..." mode = "CBC" padding = "PKCS5Padding" target_field = "...my_target_field..." } } } type = "field-renaming" } ] name = "...my_name..." namespace = "...my_namespace..." primary_key = [ [ # ... ] ] selected_fields = [ { field_path = [ "..." ] } ] sync_mode = "incremental_append" } ] } data_residency = "...my_data_residency..." destination_id = "5725b342-2d43-4e6c-90a4-e500c954e591" name = "...my_name..." namespace_definition = "destination" namespace_format = "$${SOURCE_NAMESPACE}" non_breaking_schema_updates_behavior = "ignore" prefix = "" schedule = { cron_expression = "...my_cron_expression..." schedule_type = "cron" } source_id = "b5b2b4a5-bba6-4c3f-b0ef-ab87b373f331" status = "active" tags = [ { color = "...my_color..." name = "...my_name..." tag_id = "bf69ef26-2003-4c6e-9dfa-5867d7dba86a" workspace_id = "a46bf3e2-e63d-4e32-8959-37721daec43c" } ] } ``` -------------------------------- ### Override the connector registry - Use a local file Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/connector_configuration.md Use `connector_registry` to target a specific registry. This example uses a local file. ```terraform # Use a local file data "airbyte_connector_configuration" "local_spec" { connector_name = "source-postgres" connector_version = "3.6.28" connector_registry = "/path/to/my-custom-registry.json" configuration = { host = "db.example.com" port = 5432 database = "mydb" } } ``` -------------------------------- ### Get Airbyte Permission Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/permission.md Use this data source to retrieve details about an Airbyte permission. You need to provide the `permission_id` to fetch the information. ```terraform data "airbyte_permission" "my_permission" { permission_id = "...my_permission_id..." } ``` -------------------------------- ### Override the connector registry - Use a custom URL Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/connector_configuration.md Use `connector_registry` to target a specific registry. This example uses a custom URL. ```terraform # Use a custom URL data "airbyte_connector_configuration" "custom_url" { connector_name = "source-postgres" connector_version = "3.6.28" connector_registry = "https://example.com/my-registry-spec.json" configuration = { host = "db.example.com" port = 5432 database = "mydb" } } ``` -------------------------------- ### Create an airbyte_permission resource Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/permission.md Example of how to define an airbyte_permission resource in Terraform. This requires specifying the organization ID, permission type, user ID, and optionally a workspace ID. ```terraform resource "airbyte_permission" "my_permission" { organization_id = "d109e1f3-ec33-4ca2-89ba-9b654ec67eae" permission_type = "organization_reader" user_id = "c3231461-7373-4a98-aed1-9a79ad305d18" workspace_id = "8b030f86-f6a4-490a-92a7-a996c2b017ea" } ``` -------------------------------- ### airbyte_source_definition Data Source Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/source_definition.md Example usage of the airbyte_source_definition data source to retrieve details of a source definition. ```terraform data "airbyte_source_definition" "my_sourcedefinition" { id = "...my_id..." workspace_id = "2f247b56-4c74-41ae-8045-9f64dd27512e" } ``` -------------------------------- ### Override the connector registry - Use the OSS registry only Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/connector_configuration.md Use `connector_registry` to target a specific registry. This example uses the OSS registry only. ```terraform # Use the OSS registry only data "airbyte_connector_configuration" "postgres_oss" { connector_name = "source-postgres" connector_version = "3.6.28" connector_registry = "oss" configuration = { host = "db.example.com" port = 5432 database = "mydb" } } ``` -------------------------------- ### Set up Provider Override Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Copy the provider binary to the provider-override directory and make it executable. ```bash mkdir -p provider-override cp provider-bin/terraform-provider-airbyte_darwin_arm64 provider-override/terraform-provider-airbyte chmod +x provider-override/terraform-provider-airbyte ``` -------------------------------- ### Download Provider Binaries from CI Artifacts Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/CONTRIBUTING.md Use these commands to list recent 'Test (Full)' workflow runs and download the compiled provider binaries from a specific run ID. These binaries are retained for 7 days. ```bash gh run list --workflow="test-full.yml" --limit 5 gh run download --name provider_binaries --dir ./provider-bin ``` -------------------------------- ### Configure Authentication in .env Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Edit the .env file to include Airbyte OAuth credentials and optionally a MotherDuck API key. ```bash TF_VAR_airbyte_client_id=your-client-id TF_VAR_airbyte_client_secret=your-client-secret TF_VAR_motherduck_api_key=your-motherduck-key # Optional ``` -------------------------------- ### Run Terraform Plan with Local Provider Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Load environment variables and execute 'terraform plan' using the configured local provider override. ```bash set -a; source .env; set +a TF_CLI_CONFIG_FILE=./.terraformrc terraform plan ``` -------------------------------- ### Download Provider Binaries Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Download provider binaries from a specific CI run ID into the provider-bin directory. ```bash cd test-projects/v1-tf-generic-test gh run download --name provider_binaries --dir ./provider-bin ``` -------------------------------- ### Build Terraform Provider Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/CONTRIBUTING.md Build the Terraform provider binary locally. This command compiles the Go source code into an executable file. ```bash go build -o terraform-provider-airbyte ``` -------------------------------- ### Create .terraformrc for Provider Override Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Configure Terraform to use a local provider binary by creating a .terraformrc file with development overrides. ```bash cat > .terraformrc <<'EOF' provider_installation { dev_overrides { "airbytehq/airbyte" = "./provider-override" } direct {} } EOF ``` -------------------------------- ### Get airbyte_destination Data Source Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/destination.md Use the airbyte_destination data source to retrieve details about a specific destination. You can optionally include secret coordinates for sensitive properties. ```terraform data "airbyte_destination" "my_destination" { destination_id = "...my_destination_id..." include_secret_coordinates = false } ``` -------------------------------- ### Generate Documentation Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/CONTRIBUTING.md This command regenerates the provider documentation. It is used after updating templates or Go source code to ensure the 'docs/' directory is up-to-date. ```bash uvx --from=poethepoet poe docs-generate ``` -------------------------------- ### Retrieve an airbyte source Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/source.md Use the airbyte_source data source to fetch details of a specific source by its ID. This is useful for referencing existing source configurations within your Terraform setup. ```terraform data "airbyte_source" "my_source" { include_secret_coordinates = false source_id = "...my_source_id..." } ``` -------------------------------- ### Make Provider Binary Executable Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Use this command to grant execute permissions to the Terraform provider binary. This is often necessary after downloading or building the provider. ```bash chmod +x provider-override/terraform-provider-airbyte ``` -------------------------------- ### Import an airbyte_permission resource using terraform import command Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/permission.md Shows how to import an existing airbyte_permission resource using the `terraform import` command. ```shell terraform import airbyte_permission.my_airbyte_permission "..." ``` -------------------------------- ### Get Airbyte Workspace Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/workspace.md Use this data source to retrieve details about a specific Airbyte workspace by providing its ID. This is useful for querying workspace properties like name, data residency, and notification settings. ```terraform data "airbyte_workspace" "my_workspace" { workspace_id = "...my_workspace_id..." } ``` -------------------------------- ### Download Generation Artifacts for Debugging Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/CONTRIBUTING.md When a drift check fails, download the generated provider code and documentation artifacts from CI to compare with committed files. These artifacts are the source of truth. ```bash gh run list --workflow="test-full.yml" --limit 5 gh run download --name generated_provider_code --dir /tmp/generated_from_ci gh run download --name generated_docs --dir /tmp/generated_docs ``` -------------------------------- ### Apply Terraform Changes with Local Provider Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Load environment variables and execute 'terraform apply' after a successful plan, using the local provider. ```bash set -a; source .env; set +a TF_CLI_CONFIG_FILE=./.terraformrc terraform apply ``` -------------------------------- ### Create an airbyte_source_definition resource Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source_definition.md Use this snippet to create a new source definition. Ensure you replace placeholder values with your actual Docker image tag, repository, name, and workspace ID. ```terraform resource "airbyte_source_definition" "my_sourcedefinition" { docker_image_tag = "...my_docker_image_tag..." docker_repository = "...my_docker_repository..." documentation_url = "https://fuzzy-alert.name/" name = "...my_name..." workspace_id = "2f247b56-4c74-41ae-8045-9f64dd27512e" } ``` -------------------------------- ### Clean Up Terraform Resources with Local Provider Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md Load environment variables and execute 'terraform destroy' to clean up resources, using the local provider. ```bash set -a; source .env; set +a TF_CLI_CONFIG_FILE=./.terraformrc terraform destroy ``` -------------------------------- ### Import Airbyte Source (Legacy Command) Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source.md Use this command to import an existing Airbyte source into your Terraform state. Replace '...' with the actual resource ID. ```shell terraform import airbyte_source.my_airbyte_source "..." ``` -------------------------------- ### Import Workspace using terraform import command Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/workspace.md Use the `terraform import` command to import an existing Airbyte workspace. Ensure you have the correct resource address and workspace ID. ```shell terraform import airbyte_workspace.my_airbyte_workspace "..." ``` -------------------------------- ### Run Poe Task Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/CONTRIBUTING.md Execute a Poe task for build and generation processes. Replace with the desired task defined in poe_tasks.toml. ```bash uvx --from=poethepoet poe ``` -------------------------------- ### airbyte_source Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source.md Manages an Airbyte source connector. This is the generic source resource that works with any Airbyte source connector type. Pass the connector's `definition_id` and a JSON `configuration` blob. ```APIDOC ## airbyte_source (Resource) ### Description Manages an Airbyte source connector. This is the generic source resource that works with any Airbyte source connector type. Pass the connector's `definition_id` and a JSON `configuration` blob. ### Schema #### Required - `configuration` (String, Sensitive) The values required to configure the source. The schema for this must match the schema return by source_definition_specifications/get for the source. Parsed as JSON. - `name` (String) Name of the source e.g. dev-mysql-instance. - `workspace_id` (String) Requires replacement if changed. #### Optional - `definition_id` (String) The UUID of the connector definition. One of configuration.sourceType or definitionId must be provided. Requires replacement if changed. - `resource_allocation` (Attributes) actor or actor definition specific resource requirements. if default is set, these are the requirements that should be set for ALL jobs run for this actor definition. it is overriden by the job type specific configurations. if not set, the platform will use defaults. these values will be overriden by configuration at the connection level. (see [below for nested schema](#nestedatt--resource_allocation)) - `secret_id` (String) Optional secretID obtained through the OAuth redirect flow. Requires replacement if changed. #### Read-Only - `created_at` (Number) - `source_id` (String) - `source_type` (String) ``` -------------------------------- ### Create an Airbyte Workspace Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/workspace.md Use this resource to create a new Airbyte workspace. Configure name, notifications, organization ID, and region ID as needed. ```terraform resource "airbyte_workspace" "my_workspace" { name = "...my_name..." notifications = { connection_update = { email = { enabled = false } webhook = { enabled = false url = "...my_url..." } } connection_update_action_required = { email = { enabled = true } webhook = { enabled = true url = "...my_url..." } } failure = { email = { enabled = false } webhook = { enabled = false url = "...my_url..." } } success = { email = { enabled = false } webhook = { enabled = true url = "...my_url..." } } sync_disabled = { email = { enabled = true } webhook = { enabled = true url = "...my_url..." } } sync_disabled_warning = { email = { enabled = false } webhook = { enabled = false url = "...my_url..." } } } organization_id = "4d886138-b4b4-4da8-9dca-f4d28f8550f8" region_id = "cbd99489-c363-45e8-9d04-2de8d03ae703" } ``` -------------------------------- ### Create Airbyte Postgres Source with Configuration Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/guides/getting_started.md Define an Airbyte source for Postgres using the `airbyte_source` resource and `airbyte_connector_configuration` data source. The data source validates configuration and resolves the connector definition ID. ```terraform data "airbyte_connector_configuration" "postgres_config" { connector_name = "source-postgres" configuration = { host = "db.example.com" port = 5432 database = "mydb" username = "readonly" } configuration_secrets = { password = var.db_password } } resource "airbyte_source" "postgres" { name = "Production Postgres" workspace_id = var.workspace_id definition_id = data.airbyte_connector_configuration.postgres_config.definition_id configuration = data.airbyte_connector_configuration.postgres_config.configuration_json } ``` -------------------------------- ### Local Provider Build Configuration Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/README.md Configure Terraform to use a local build of the Airbyte provider by specifying `dev_overrides` in your `.terraformrc` file. Replace `` with your Go binary path. ```hcl provider_installation { dev_overrides { "registry.terraform.io/airbyte/scaffolding" = "" } # For all other providers, install them directly from their origin provider # registries as normal. If you omit this, Terraform will _only_ use # the dev_overrides block, and so no other providers will be available. direct {} } ``` -------------------------------- ### Import Declarative Source Definition with terraform import command Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/declarative_source_definition.md How to import an existing declarative source definition using the terraform import command. Requires the resource ID and workspace ID, formatted as a JSON string. ```shell terraform import airbyte_declarative_source_definition.my_airbyte_declarative_source_definition '{"id": "...", "workspace_id": "..."}' ``` -------------------------------- ### airbyte_workspace Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/workspace.md Workspace Resource. Manages an Airbyte Workspace. ```APIDOC ## airbyte_workspace Resource ### Description Manages an Airbyte Workspace. ### Schema #### Required - `name` (String) Name of the workspace #### Optional - `notifications` (Attributes) Configures workspace notifications. (see [below for nested schema](#nestedatt--notifications)) - `organization_id` (String) ID of organization to add workspace to. Requires replacement if changed. - `region_id` (String) #### Read-Only - `data_residency` (String) - `workspace_id` (String) ### Nested Schema for `notifications` Optional: - `connection_update` (Attributes) Configures a notification. (see [below for nested schema](#nestedatt--notifications--connection_update)) - `connection_update_action_required` (Attributes) Configures a notification. (see [below for nested schema](#nestedatt--notifications--connection_update_action_required)) - `failure` (Attributes) Configures a notification. (see [below for nested schema](#nestedatt--notifications--failure)) - `success` (Attributes) Configures a notification. (see [below for nested schema](#nestedatt--notifications--success)) - `sync_disabled` (Attributes) Configures a notification. (see [below for nested schema](#nestedatt--notifications--sync_disabled)) - `sync_disabled_warning` (Attributes) Configures a notification. (see [below for nested schema](#nestedatt--notifications--sync_disabled_warning)) ### Nested Schema for `notifications.connection_update` Optional: - `email` (Attributes) Configures an email notification. (see [below for nested schema](#nestedatt--notifications--connection_update--email)) - `webhook` (Attributes) Configures a webhook notification. (see [below for nested schema](#nestedatt--notifications--connection_update--webhook)) ### Nested Schema for `notifications.connection_update.email` Optional: - `enabled` (Boolean) ### Nested Schema for `notifications.connection_update.webhook` Optional: - `enabled` (Boolean) - `url` (String) ### Nested Schema for `notifications.connection_update_action_required` Optional: - `email` (Attributes) Configures an email notification. (see [below for nested schema](#nestedatt--notifications--connection_update_action_required--email)) - `webhook` (Attributes) Configures a webhook notification. (see [below for nested schema](#nestedatt--notifications--connection_update_action_required--webhook)) ### Nested Schema for `notifications.connection_update_action_required.email` Optional: - `enabled` (Boolean) ### Nested Schema for `notifications.connection_update_action_required.webhook` Optional: - `enabled` (Boolean) - `url` (String) ### Nested Schema for `notifications.failure` Optional: - `email` (Attributes) Configures an email notification. (see [below for nested schema](#nestedatt--notifications--failure--email)) - `webhook` (Attributes) Configures a webhook notification. (see [below for nested schema](#nestedatt--notifications--failure--webhook)) ### Nested Schema for `notifications.failure.email` Optional: - `enabled` (Boolean) ### Nested Schema for `notifications.failure.webhook` Optional: - `enabled` (Boolean) - `url` (String) ### Nested Schema for `notifications.success` Optional: - `email` (Attributes) Configures an email notification. (see [below for nested schema](#nestedatt--notifications--success--email)) - `webhook` (Attributes) Configures a webhook notification. (see [below for nested schema](#nestedatt--notifications--success--webhook)) ### Nested Schema for `notifications.success.email` Optional: - `enabled` (Boolean) ### Nested Schema for `notifications.success.webhook` Optional: - `enabled` (Boolean) - `url` (String) ### Nested Schema for `notifications.sync_disabled` Optional: - `email` (Attributes) Configures an email notification. (see [below for nested schema](#nestedatt--notifications--sync_disabled--email)) - `webhook` (Attributes) Configures a webhook notification. (see [below for nested schema](#nestedatt--notifications--sync_disabled--webhook)) ### Nested Schema for `notifications.sync_disabled.email` Optional: - `enabled` (Boolean) ### Nested Schema for `notifications.sync_disabled.webhook` Optional: - `enabled` (Boolean) - `url` (String) ### Nested Schema for `notifications.sync_disabled_warning` Optional: - `email` (Attributes) Configures an email notification. (see [below for nested schema](#nestedatt--notifications--sync_disabled_warning--email)) - `webhook` (Attributes) Configures a webhook notification. (see [below for nested schema](#nestedatt--notifications--sync_disabled_warning--webhook)) ### Nested Schema for `notifications.sync_disabled_warning.email` Optional: - `enabled` (Boolean) ### Nested Schema for `notifications.sync_disabled_warning.webhook` Optional: - `enabled` (Boolean) - `url` (String) ``` -------------------------------- ### Using airbyte_connector_configuration Data Source Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/destination.md Use the `airbyte_connector_configuration` data source to automatically resolve the connector's `definition_id`, validate configuration at plan time, and separate sensitive from non-sensitive values for clean diffs. ```terraform data "airbyte_connector_configuration" "bigquery" { connector_name = "destination-bigquery" connector_version = "2.9.4" configuration = { project_id = "my-gcp-project" dataset_id = "my_dataset" dataset_location = "US" loading_method = { method = "GCS Staging" gcs_bucket_name = "my-staging-bucket" gcs_bucket_path = "airbyte-staging" } } configuration_secrets = { credentials_json = var.bigquery_credentials } } resource "airbyte_destination" "bigquery" { name = "BigQuery Production" workspace_id = var.workspace_id definition_id = data.airbyte_connector_configuration.bigquery.definition_id configuration = data.airbyte_connector_configuration.bigquery.configuration_json } ``` -------------------------------- ### Import Airbyte Source (Terraform v1.5.0+) Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source.md Utilize the `import` block for importing Airbyte resources in Terraform versions 1.5.0 and later. Ensure the `to` and `id` attributes are correctly specified. ```terraform import { to = airbyte_source.my_airbyte_source id = "..." } ``` -------------------------------- ### Configure Local Provider Overrides Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/README.md Set up a '.terraformrc' file with 'dev_overrides' to use local provider builds. This ensures Terraform uses your local binary instead of fetching from registries. ```hcl provider_installation { dev_overrides { "registry.terraform.io/airbytehq/airbyte" = "" } # For all other providers, install them directly from their origin provider # registries as normal. If you omit this, Terraform will _only_ use # the dev_overrides block, and so no other providers will be available. direct {} } ``` -------------------------------- ### Pin to a specific connector version Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/data-sources/connector_configuration.md Fetch the spec for an exact version and validate configuration against it. ```terraform data "airbyte_connector_configuration" "github" { connector_name = "source-github" connector_version = "2.0.0" configuration = { repositories = ["airbytehq/airbyte"] credentials = { option_title = "PAT Credentials" personal_access_token = var.github_pat } } } ``` -------------------------------- ### Using airbyte_connector_configuration data source Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source.md Use the airbyte_connector_configuration data source to automatically resolve the connector's definition_id, validate configuration at plan time, and separate sensitive from non-sensitive values for clean diffs. ```terraform data "airbyte_connector_configuration" "postgres" { connector_name = "source-postgres" connector_version = "3.6.28" configuration = { host = "db.example.com" port = 5432 database = "mydb" schemas = ["public"] ssl_mode = { mode = "prefer" } } configuration_secrets = { username = var.pg_user password = var.pg_password } } resource "airbyte_source" "postgres" { name = "Postgres Production" workspace_id = var.workspace_id definition_id = data.airbyte_connector_configuration.postgres.definition_id configuration = data.airbyte_connector_configuration.postgres.configuration_json } ``` -------------------------------- ### Using Inline JSON Configuration Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/destination.md For simpler cases, pass JSON configuration directly. The entire `configuration` attribute is sensitive, so all values are hidden in plan output. ```terraform resource "airbyte_destination" "s3" { name = "S3 Data Lake" workspace_id = var.workspace_id definition_id = "4816b78f-1489-44c1-9060-4b19d5fa9571" configuration = jsonencode({ s3_bucket_name = "my-data-lake" s3_bucket_path = "airbyte" s3_bucket_region = "us-east-1" access_key_id = var.aws_access_key secret_access_key = var.aws_secret_key format = { format_type = "Parquet" } }) } ``` -------------------------------- ### Import an airbyte_permission resource using import block Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/permission.md Demonstrates how to import an existing airbyte_permission resource using the `import` block in Terraform v1.5.0 and later. ```terraform import { to = airbyte_permission.my_airbyte_permission id = "..." } ``` -------------------------------- ### Terraform Import Command Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/destination.md Use this command to import an existing Airbyte destination into your Terraform state. Replace '...' with the actual ID of the destination. ```shell terraform import airbyte_destination.my_airbyte_destination "..." ``` -------------------------------- ### Code Generation Lineage Diagram Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/CONTRIBUTING.md Visual representation of the multi-step pipeline for generating the Terraform provider, from the upstream OpenAPI spec to binary builds. ```text ┌──────────────────────────────────────────┐ │ 1. Upstream OpenAPI Spec │ │ (airbyte-platform-internal) │ └──────────────────┬───────────────────────┘ │ ▼ ┌──────────────────────────────────────────┐ │ 2. Spec Transformation Script │ │ (generate_terraform_spec.py) │ └──────────────────┬───────────────────────┘ │ ▼ ┌──────────────────────────────────────────┐ │ 3. Generated OpenAPI Spec │ │ (generated/api_terraform.yaml) │ └──────────────────┬───────────────────────┘ │ + overlay applied ▼ ┌──────────────────────────────────────────┐ │ 4. Speakeasy Overlay │ │ (terraform_speakeasy.yaml) │ └──────────────────┬───────────────────────┘ │ ▼ ┌──────────────────────────────────────────┐ │ 5. Speakeasy Code Generation │ │ (internal/sdk/, internal/provider/) │ └──────────┬───────────────────┬───────────┘ │ │ ▼ ▼ ┌────────────────────┐ ┌───────────────────┐ │ 6. Docs Generation │ │ 7. Binary Build │ │ (docs/) │ │ (dist/) │ └────────────────────┘ └───────────────────┘ ``` -------------------------------- ### Using inline JSON configuration Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source.md For simpler cases, pass JSON configuration directly. The entire configuration attribute is sensitive, so all values are hidden in plan output. ```terraform resource "airbyte_source" "github" { name = "GitHub" workspace_id = var.workspace_id definition_id = "ef69ef6e-aa7f-4af1-a01d-ef775033524e" configuration = jsonencode({ repositories = ["airbytehq/airbyte"] credentials = { option_title = "PAT Credentials" personal_access_token = var.github_pat } }) } ``` -------------------------------- ### Configure Airbyte Terraform Provider Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/guides/getting_started.md Set up the Airbyte provider in your Terraform configuration, specifying the source and version. References variables for sensitive data like client ID and secret. ```terraform terraform { required_providers { airbyte = { source = "airbytehq/airbyte" version = "~> 1.0" } } } provider "airbyte" { client_id = var.client_id client_secret = var.client_secret # Omit server_url for Airbyte Cloud (defaults to https://api.airbyte.com/v1) # server_url = "http://localhost:8000/api/public/v1/" } ``` -------------------------------- ### Migrating from a typed resource Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/source.md Typed source resources are replaced by the generic airbyte_source resource in provider 1.0+. Use a moved block (Terraform >= 1.8) for a zero-downtime migration. ```terraform moved { from = airbyte_source_pardot.my_source to = airbyte_source.my_source } resource "airbyte_source" "my_source" { name = "Pardot" workspace_id = var.workspace_id definition_id = "5e6175e5-68e1-4c17-bff9-56103bbb0d80" configuration = jsonencode({ client_id = var.pardot_client_id client_secret = var.pardot_client_secret refresh_token = var.pardot_refresh_token pardot_business_unit_id = "0Uv5g0000008OT2CAM" }) } ``` -------------------------------- ### Terraform CLI Import Command for Airbyte Connection Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/connection.md Utilize the terraform import command to bring an Airbyte connection into your Terraform state. Provide the resource name and the connection ID. ```shell terraform import airbyte_connection.my_airbyte_connection "..." ``` -------------------------------- ### Migrating from a Typed Resource Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/destination.md Use a `moved` block (Terraform >= 1.8) for a zero-downtime migration from typed destination resources to the generic `airbyte_destination` resource. ```terraform moved { from = airbyte_destination_bigquery.my_dest to = airbyte_destination.my_dest } resource "airbyte_destination" "my_dest" { name = "BigQuery" workspace_id = var.workspace_id definition_id = "22f6c74f-5699-40ff-833c-4a879ea40133" configuration = jsonencode({ project_id = "my-gcp-project" dataset_id = "my_dataset" dataset_location = "US" credentials_json = var.bigquery_credentials }) } ``` -------------------------------- ### Terraform CI Plan Check Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md This command sequence is used in CI to perform a plan-only smoke test. It validates that the CI-built provider binary can load, parse HCL, resolve data sources, and produce a valid execution plan without applying changes. ```bash terraform init terraform plan ``` -------------------------------- ### Terraform Import Block (v1.5.0+) Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/destination.md For Terraform versions 1.5.0 and later, utilize the `import` block for a more integrated import experience. Ensure '...' is replaced with the correct destination ID. ```terraform import { to = airbyte_destination.my_airbyte_destination id = "..." } ``` -------------------------------- ### airbyte_connection Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/resources/connection.md Provides an Airbyte Connection resource. This resource allows you to manage Airbyte Connections, which define how data is replicated from a source to a destination. ```APIDOC ## resource "airbyte_connection" "my_connection" ### Description Provides an Airbyte Connection resource. This resource allows you to manage Airbyte Connections, which define how data is replicated from a source to a destination. ### Schema #### Required - `destination_id` (String) Requires replacement if changed. - `source_id` (String) Requires replacement if changed. #### Optional - `configurations` (Attributes) A list of configured stream options for a connection. (see [below for nested schema](#nestedatt--configurations)) - `data_residency` (String, Deprecated) - `name` (String) Optional name of the connection - `namespace_definition` (String) Define the location where the data will be stored in the destination. Default: "destination"; must be one of ["source", "destination", "custom_format"] - `namespace_format` (String) Used when namespaceDefinition is 'custom_format'. If blank then behaves like namespaceDefinition = 'destination'. If "${SOURCE_NAMESPACE}" then behaves like namespaceDefinition = 'source'. - `non_breaking_schema_updates_behavior` (String) Set how Airbyte handles syncs when it detects a non-breaking schema change in the source. Default: "ignore"; must be one of ["ignore", "disable_connection", "propagate_columns", "propagate_fully"] - `prefix` (String) Prefix that will be prepended to the name of each stream when it is written to the destination (ex. “airbyte_” causes “projects” => “airbyte_projects”). Default: "" - `schedule` (Attributes) schedule for when the the connection should run, per the schedule type (see [below for nested schema](#nestedatt--schedule)) - `status` (String) must be one of ["active", "inactive", "deprecated", "locked"] - `tags` (Attributes List) (see [below for nested schema](#nestedatt--tags)) #### Read-Only - `connection_id` (String) - `created_at` (Number) - `status_reason` (String) - `workspace_id` (String) ### Nested Schema for `configurations` Optional: - `streams` (Attributes Set) (see [below for nested schema](#nestedatt--configurations--streams)) ### Nested Schema for `configurations.streams` (Schema details for streams not fully provided in the source text, but would typically include fields like `cursor_field`, `destination_object_name`, `include_files`, `mappers`, `name`, `namespace`, `primary_key`, `selected_fields`, `sync_mode`) ``` -------------------------------- ### List CI Runs Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/test-projects/README.md List recent CI runs for the test-full.yml workflow to identify a RUN_ID. ```bash gh run list --workflow="test-full.yml" --limit 5 ``` -------------------------------- ### Configure airbyte Provider Source: https://github.com/airbytehq/terraform-provider-airbyte/blob/main/docs/index.md Configure the airbyte Terraform provider with required provider details and optional authentication parameters. ```terraform terraform { required_providers { airbyte = { source = "airbytehq/airbyte" version = "1.2.1" } } } provider "airbyte" { server_url = "..." # Optional } ```