| page_title | subcategory | description |
|---|---|---|
airbyte_source - terraform-provider-airbyte |
Manages an Airbyte source connector. This is the generic resource for all source types. |
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. Use the airbyte_connector_configuration data source to resolve connector names to definition IDs and to get clean Terraform diffs on non-sensitive values.
~> Migrating from typed resources? If you are upgrading from a pre-1.0 provider version or moving from a typed resource like airbyte_source_postgres, see the Migrating to 1.0 guide for step-by-step instructions using Terraform's moved block.
Use the airbyte_connector_configuration data source to resolve the connector's definition_id automatically, validate configuration at plan time, and separate sensitive from non-sensitive values for clean diffs:
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
}For simpler cases where you don't need the data source, pass JSON configuration directly. The entire configuration attribute is sensitive, so all values are hidden in plan output:
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
}
})
}Typed source resources (airbyte_source_postgres, airbyte_source_github, etc.) are replaced by this generic airbyte_source resource in provider 1.0+. Use a moved block (Terraform >= 1.8) for a zero-downtime migration:
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"
})
}For full details including alternative methods for older Terraform versions, see the Migrating to 1.0 guide.
configuration(String) 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.
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)secret_id(String) Optional secretID obtained through the OAuth redirect flow. Requires replacement if changed.
created_at(Number)source_id(String)source_type(String)
Optional:
default(Attributes) optional resource requirements to run workers (blank for unbounded allocations) (see below for nested schema)job_specific(Attributes List) (see below for nested schema)
Optional:
cpu_limit(String)cpu_request(String)ephemeral_storage_limit(String)ephemeral_storage_request(String)memory_limit(String)memory_request(String)
Optional:
job_type(String) enum that describes the different types of jobs that the platform runs. Not Null; must be one of ["get_spec", "check_connection", "discover_schema", "sync", "reset_connection", "connection_updater", "replicate"]resource_requirements(Attributes) optional resource requirements to run workers (blank for unbounded allocations). Not Null (see below for nested schema)
Optional:
cpu_limit(String)cpu_request(String)ephemeral_storage_limit(String)ephemeral_storage_request(String)memory_limit(String)memory_request(String)
Import is supported using the following syntax:
terraform import airbyte_source.my_airbyte_source "..."In Terraform v1.5.0 and later, the import block can be used:
import {
to = airbyte_source.my_airbyte_source
id = "..."
}