From 53a73daae64a898ce27030baa91f5a8e9f436bff Mon Sep 17 00:00:00 2001 From: Vitaly Mosin <73104048+beevital@users.noreply.github.com> Date: Fri, 27 May 2022 15:56:52 +0300 Subject: [PATCH] Update connector_resource docs (#34) * connector_resource docs update * connector_resource docs typo fix * Update docs/resources/connector.md Co-authored-by: 5tran-alexil * Update docs/resources/connector.md Co-authored-by: 5tran-alexil * Apply suggestions from code review Co-authored-by: 5tran-alexil --- CHANGELOG.md | 5 +++++ docs/resources/connector.md | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dea35a76..258462cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v0.4.3...HEAD) +## [0.4.4](https://github.com/fivetran/terraform-provider-fivetran/compare/v0.4.3...v0.4.4) - 2022-06-01 + +## Documentation +- `connector_resource` documentation update with information about how to solve indirect dependency between connector and destination + ## [0.4.3](https://github.com/fivetran/terraform-provider-fivetran/compare/v0.4.2...v0.4.3) - 2022-05-24 ## Fixed diff --git a/docs/resources/connector.md b/docs/resources/connector.md index 5742a558..15561836 100644 --- a/docs/resources/connector.md +++ b/docs/resources/connector.md @@ -36,6 +36,28 @@ resource "fivetran_connector" "amplitude" { } ``` +### NOTE: resources indirect dependencies + +The connector resource receives the `group_id` parameter value from the group resource, but the destination resource depends on the group resource. When you try to destroy the destination resource infrastructure, the terraform plan is created successfully, but once you run the `terraform apply` command, it returns an error because the Fivetran API doesn't let you delete destinations that have linked connectors. To solve this problem, you should either explicitly define `depends_on` between the connector and destination: + +```hcl +resource "fivetran_connector" "amplitude" { + ... + depends_on = [ + fivetran_destination.my_destination + ] +} +``` + +or get the group ID from the destination: + +```hcl +resource "fivetran_connector" "amplitude" { + group_id = fivetran_destination.my_destination.group_id + ... +} +``` + ## Schema ### Required