fivetran / terraform-provider-fivetran

Terraform Provider for Fivetran
https://fivetran.com
Apache License 2.0
40 stars 23 forks source link

DyhnamoDB connector - Error: Provider produced inconsistent result after apply #298

Closed Daniele-RedCloud closed 5 months ago

Daniele-RedCloud commented 5 months ago

Describe the bug While updating a DynamoDB connector by switching to umpacked mode and empty list of tables terraform plan is successful but terraform apply fails with a provider error.

To Reproduce

resource "fivetran_connector" "dynamodb" {
  group_id = var.group_id

  service = "dynamodb"

  run_setup_tests = "true"

  destination_schema {
    name = var.schema_name
  }

  config {
    external_id        = var.group_id
    role_arn           = var.aws_iam_arn
    aws_region_code    = var.aws_region
    sync_mode          = "UseUnpackedModeOnly"
    packed_mode_tables = []
  }
}

Expected behavior Terraform apply to succeed.

Logs & Output

Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.connector.fivetran_connector.dynamodb,
│ provider "provider[\"registry.terraform.io/fivetran/fivetran\"]" produced
│ an unexpected new value: .config.packed_mode_tables: was
│ cty.SetValEmpty(cty.String), but now null.
│
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Plugin version:

Additional context

Note that if I instead use:

packed_mode_tables = null

terraform succeed but the connector fails to synchronise with the following error:

Rescheduling to recover quickly after failure Cannot invoke \"java.util.Set.contains(Object)\" because \"this.packedModeTables\" is null
beevital commented 5 months ago

Hey @Daniele-RedCloud! We had similar issue with empty strings already. Some connectors don't return empty values in response, so it causes inconsistency in state after apply. Will be fixed in next release.

beevital commented 5 months ago

https://github.com/fivetran/terraform-provider-fivetran/pull/300 fix PR raised

beevital commented 5 months ago

Fixed in v1.1.22