Version 1.0 of the Airbyte Terraform provider introduced generic connector resources (airbyte_source and airbyte_destination) that replace the typed connector-specific resources (e.g., airbyte_source_postgres, airbyte_destination_bigquery).
Removal Notice Typed connector-specific resources were deprecated in 1.0 and have been removed in 1.1. If you are upgrading from a pre-1.1 provider version, you must migrate to the generic resources before upgrading to v1.1.
To avoid combining version updates with resource migration in a single step, we recommend upgrading in phases:
- Upgrade to v1.0 — Typed resources still work but emit deprecation warnings. Your existing configuration continues to function without changes.
- Resolve all deprecation warnings — Migrate each typed resource to its generic equivalent using
movedblocks (see Migration walkthrough below). Runterraform planafter each change and confirm no destroy actions. Take your time — v1.0 is stable and there is no rush. - Upgrade to v1.1+ — Once all deprecation warnings are resolved and your
terraform planis clean, upgrade the provider version. Since all typed resources have already been replaced, the upgrade is a no-op.
Tip: The
movedblock approach (Step 2) preserves your existing Airbyte resources in-place. Terraform will showmovedin the plan output, notcreate/destroy. This avoids any disruption to running connections.
The recommended way to use the generic resources is with the airbyte_connector_configuration data source, which provides:
- Automatic
definition_idresolution from connector name - Optional version pinning via
connector_version(e.g."3.6.28") - Type-validated configuration against the connector's JSONSchema spec (catches errors at
terraform plantime) - Separation of sensitive and non-sensitive values for clean diffs
Warning The
movedblock approach requires Terraform 1.8 or later. For older versions, see Alternative methods (Terraform < 1.8) below.
This walkthrough shows a complete migration from a typed resource to the generic resource with validated configuration, using moved to preserve state.
Remove the typed resource and add a moved block pointing from the old address to the new one. Use the airbyte_connector_configuration data source for type-validated configuration and automatic definition_id resolution.
Before (typed resource):
resource "airbyte_source_postgres" "my_pg_source" {
name = "Production Postgres"
workspace_id = var.workspace_id
configuration = {
host = "db.example.com"
port = 5432
database = "mydb"
username = "readonly"
password = var.db_password
}
}After (generic resource with validated configuration):
data "airbyte_connector_configuration" "my_pg_source_config" {
connector_name = "source-postgres"
# connector_version = "3.6.28" # optional: pin to a specific version
configuration = {
host = "db.example.com"
port = 5432
database = "mydb"
username = "readonly"
}
configuration_secrets = {
password = var.db_password
}
}
resource "airbyte_source" "my_pg_source" {
name = "Production Postgres"
workspace_id = var.workspace_id
definition_id = data.airbyte_connector_configuration.my_pg_source_config.definition_id
configuration = data.airbyte_connector_configuration.my_pg_source_config.configuration_json
}
// ℹ️ The `moved` block informs terraform to not
// delete and/or recreate your resources.
// This block may be deleted once your migration
// to the 1.0 provider is fully complete.
moved {
from = airbyte_source_postgres.my_pg_source
to = airbyte_source.my_pg_source
}The airbyte_connector_configuration data source validates your configuration against the connector's JSON schema during terraform plan, so typos and missing fields are caught before apply. Non-sensitive values (host, port, etc.) produce clean diffs, while the merged configuration_json is marked sensitive.
Update any resources that reference the old typed resource:
# Before:
source_id = airbyte_source_postgres.my_pg_source.source_id
# After:
source_id = airbyte_source.my_pg_source.source_idRun terraform plan and confirm:
- There are no destroy actions.
- Terraform shows
movedfor the resource, notcreate/destroy. - Any updates shown are configuration changes you expect.
Run terraform apply to complete the migration. After a successful apply, you may optionally remove the moved block — it is only required during the initial migration.
The same approach works for destinations:
data "airbyte_connector_configuration" "my_bigquery_dest_config" {
connector_name = "destination-bigquery"
# connector_version = "2.9.4" # optional: pin to a specific version
configuration = {
project_id = "my-gcp-project"
dataset_id = "my_dataset"
}
configuration_secrets = {
credentials_json = var.gcp_credentials
}
}
resource "airbyte_destination" "my_bigquery_dest" {
name = "BigQuery"
workspace_id = var.workspace_id
definition_id = data.airbyte_connector_configuration.my_bigquery_dest_config.definition_id
configuration = data.airbyte_connector_configuration.my_bigquery_dest_config.configuration_json
}
// ℹ️ The `moved` block informs terraform to not
// delete and/or recreate your resources.
// This block may be deleted once your migration
// to the 1.0 provider is fully complete.
moved {
from = airbyte_destination_bigquery.my_bigquery_dest
to = airbyte_destination.my_bigquery_dest
}If you were using airbyte_source_custom or airbyte_destination_custom from a pre-1.0 provider version, these have been replaced by the generic airbyte_source and airbyte_destination resources. The generic resources have the same contract (JSON configuration, definition_id, etc.), so migrating is straightforward:
resource "airbyte_source" "my_source" {
name = "My Custom Source"
workspace_id = var.workspace_id
definition_id = "ab5e6175-68e1-4c17-bff9-56103bbb0d80"
configuration = jsonencode({
api_key = var.api_key
host = "api.example.com"
})
}
// ℹ️ The `moved` block informs terraform to not
// delete and/or recreate your resources.
// This block may be deleted once your migration
// to the 1.0 provider is fully complete.
moved {
from = airbyte_source_custom.my_source
to = airbyte_source.my_source
}Note
- The
_customresources already used JSON configuration, so yourconfigurationblock can remain unchanged. Only the resource type name changes.- Optionally, you can leverage the
airbyte_connector_configurationdata source for pre-validation of data types and auto-discovery of the internal definition ID. See above example for more information.
For simpler cases where you don't need type validation or the sensitive/non-sensitive split, pass JSON configuration directly:
resource "airbyte_source" "my_source" {
name = "My Postgres Source"
workspace_id = var.workspace_id
definition_id = "decd338e-5647-4c0b-adf4-da0e75f5a750"
configuration = jsonencode({
host = "db.example.com"
port = 5432
database = "mydb"
username = "readonly"
password = var.db_password
})
}The entire configuration attribute is marked as sensitive, so all values are hidden in plan output. Use this approach only if you don't need per-field diff visibility.
The generic resource requires a definition_id to identify the connector type. You can find it by:
- Using the
airbyte_connector_configurationdata source to resolve it automatically from the connector name (recommended). - Running
terraform state show airbyte_source_postgres.my_sourcebefore migrating and noting thedefinition_idattribute. - Looking up the connector in the Airbyte UI under Settings > Sources or Settings > Destinations.
If you cannot use Terraform 1.8+ and the moved block, see the Terraform documentation on moving resources and state management for alternative approaches such as terraform state rm + terraform import.