Vitor Fortunato
05/28/2024, 6:16 AMkapa.ai
05/28/2024, 6:17 AMhcl terraform { required_providers { airbyte = { source = "airbytehq/airbyte" version = "x.y.z" # specify the required version } } } provider "airbyte" { server_url = var.server_url api_key = var.api_key }
- main.tf: hcl resource "airbyte_workspace" "example" { name = "example_workspace" } resource "airbyte_source" "example" { name = "example_source" workspace_id = airbyte_workspace.example.id source_definition_id = "source-definition-id" connection_configuration = jsonencode({ "host" = "example_host" "port" = 5432 "database" = "example_db" "username" = "example_user" "password" = "example_password" }) } resource "airbyte_destination" "example" { name = "example_destination" workspace_id = airbyte_workspace.example.id destination_definition_id = "destination-definition-id" connection_configuration = jsonencode({ "host" = "example_host" "port" = 5432 "database" = "example_db" "username" = "example_user" "password" = "example_password" }) }
- variables.tf: hcl variable "server_url" { description = "The URL of the Airbyte server" type = string } variable "api_key" { description = "The API key for Airbyte" type = string }
3. Version Control: Store these configuration files in a Git repository to manage changes and collaborate with your team. 4. Additional Resources: For more detailed guidance, you can refer to the following resources: - [Getting started with Airbyte's Terraform provider](https://reference.airbyte.com/reference/using-the-terraform-provider) - [YouTube tutorial on using Airbyte with the new Terraform provider]() - Examples of data stacks using the Terraform provider in the [quickstarts repository](https://github.com/airbytehq/quickstarts) By following these steps, you can set up a Terraform repository to manage your Airbyte infrastructure as code effectively.