Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/resources/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,40 @@ resource "airbyte_connection" "my_connection" {
}
```

Example using [Stream Module](#nestedatt--stream-module)

```terraform

module "source_postgres_streams" {
source = "airbytehq/stream-discovery/airbyte"
airbyte_api_token = var.airbyte_api_token
source_id = airbyte_source_postgres.my_source_postgres.source_id
destination_id = airbyte_destination_bigquery.my_destination_bigquery.destination_id
}

locals {
full_refresh_streams = [for stream in module.source_postgres_streams.streams :
{
name = stream.streamName
sync_mode = "full_refresh_overwrite"
}
]
}


resource "airbyte_connection" "postgres_to_bigquery_full_refresh" {
name = "Postgres to BigQuery Full Refresh"
source_id = airbyte_source_postgres.my_source_postgres.source_id
destination_id = airbyte_destination_bigquery.my_destination_bigquery.destination_id
schedule = {
schedule_type = "manual"
}
configurations = {
streams = local.full_refresh_streams
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down Expand Up @@ -94,6 +128,9 @@ Optional:
- `primary_key` (List of List of String) Paths to the fields that will be used as primary key. This field is REQUIRED if `destination_sync_mode` is `*_dedup` unless it is already supplied by the source schema.
- `sync_mode` (String) must be one of ["full_refresh_overwrite", "full_refresh_append", "incremental_append", "incremental_deduped_history"]

<a id="nestedatt--stream-module"></a>
## Stream Module
If you want to discover the available streams programmatically with terraform, we have released a [Stream Discovery Module](https://registry.terraform.io/modules/airbytehq/stream-discovery/airbyte/latest) which fetches the available streams and sync modes between a source and destination.


<a id="nestedatt--schedule"></a>
Expand Down