fivetran / terraform-provider-fivetran

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

DynamoDB - schema was empty but now null #317

Closed ann8ty closed 16 hours ago

ann8ty commented 1 month ago

Describe the bug

Trying to get the schema to exist and be enabled, with BLOCK_ALL, but have no tables in it yet. As a method of trying to workaround bugs logged yesterday.

│ When applying changes to fivetran_connector_schema_config.dynamodb_schema, provider "provider[\"registry.terraform.io/fivetran/fivetran\"]" produced an unexpected new value: .schemas["dynamodb_raw"].tables: was │ cty.MapValEmpty(cty.Object(map[string]cty.Type{"columns":cty.Map(cty.Object(map[string]cty.Type{"enabled":cty.Bool, "hashed":cty.Bool})), "enabled":cty.Bool, "sync_mode":cty.String})), but now null. │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker.

To Reproduce

resource "fivetran_connector_schema_config" "dynamodb_schema" {
  connector_id = data.aws_ssm_parameter.ssm_dynamodb_connector_id.value

  schema_change_handling = "BLOCK_ALL"

    schemas = {
      "dynamodb_raw" = {
        enabled = true

        tables = {} 

    }
  }
}

Expected behavior not to fail.

schema exists and is enabled, but no tables selected

equivalent to

resource "fivetran_connector_schema_config" "dynamodb_schema" {
  connector_id = data.aws_ssm_parameter.ssm_dynamodb_connector_id.value

  schema_change_handling = "BLOCK_ALL"

    schemas = {
      "dynamodb_raw" = {
        enabled = true

#        tables = {}   see no tables / diff from above

    }
  }
}

**Logs & Output**

tf-fivetran-schemas $ AWS_PROFILE="dbf" terraform plan -var-file="./$ENVIROMENT_LONG_NAME/$CDK_PREFIX.tfvars" -out=.terraform/$CDK_PREFIX.out

....

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: ~ update in-place

Terraform will perform the following actions:

fivetran_connector_schema_config.dynamodb_schema will be updated in-place

~ resource "fivetran_connector_schema_config" "dynamodb_schema" { ~ id = "xxx" -> (known after apply)

Plan: 0 to add, 1 to change, 0 to destroy.

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Saved the plan to: .terraform/ann5.out

To perform exactly these actions, run the following command to apply: terraform apply ".terraform/ann5.out" (.venv) ~/code/data/data-infra/tf-fivetran-schemas $ AWS_PROFILE="dbf" terraform apply .terraform/$CDK_PREFIX.out

fivetran_connector_schema_config.dynamodb_schema: Modifying... [id=xxx] ╷ │ Error: Provider produced inconsistent result after apply │ │ When applying changes to fivetran_connector_schema_config.dynamodb_schema, provider "provider[\"registry.terraform.io/fivetran/fivetran\"]" produced an unexpected new value: .schemas["dynamodb_raw"].tables: was │ cty.MapValEmpty(cty.Object(map[string]cty.Type{"columns":cty.Map(cty.Object(map[string]cty.Type{"enabled":cty.Bool, "hashed":cty.Bool})), "enabled":cty.Bool, "sync_mode":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:**
v1.1.24

**Additional context**

Trying to work around issues reported yesterday / clean TF state file, rm the schema from the state file, remove the tables by hand from the console, trying to get to clean state.
beevital commented 1 week ago

Should be fixed in v1.2.0

beevital commented 16 hours ago

Closing the issue as the fix was released. Feel free to re-open or open a new one id the fix didn't work for you.