Skip to content

Cannot create Postgres CDC ClickPipe with managed_table=true #543

Description

@scottking-crestron

Description

Trying to Terraform a Postgres CDC ClickPipe with managed_table=true for the destination makes the plan fail. While the documentation says managed_table=true is the default, when you omit managed_table, the plan shows managed_table=false.

Interestingly, when I leave managed_table out of my destination block and let it apply the plan that says managed_table=false, I seem to somehow get managed tables anyway. This conflicting behavior makes me nervous and confused about what's really going on here.

Terraform itself says this is a bug in the provider that should be reported, and I did not see it filed so I'm filing it here. Apologies if I somehow missed it.

Cloud provider

Azure

Service tier

Not applicable

Affected resource(s)

clickhouse_clickpipe

Provider version

3.14.0

Terraform version

1.13.3

Terraform configuration

resource "clickhouse_clickpipe" "postgres_pipe" {
  name       = "Analytics Postgres"
  service_id = var.clickhouse_service_id

  source = {
    postgres = {
      host     = var.postgres_host
      port     = var.postgres_port
      database = "test"

      credentials = {
        username = var.postgres_clickpipes_username
        password = var.postgres_clickpipes_password
      }

      settings = {
        replication_mode = "cdc"
        publication_name = "testpub"
      }

      table_mappings = [
        {
            source_schema_name = "telemetry"
            source_table       = "telemetry"
            target_table       = "telemetry_table"
            table_engine       = "ReplacingMergeTree"
        }
      ]
    }
  }

  destination = {
    database = "analytics"
    managed_table = true
  }
}

Expected behavior

Terraform plan contains a ClickPipe with destination.managed_table = true

Actual behavior

Plan fails with this error message:

Planning failed. Terraform encountered an error while generating this plan. 
Error: Provider produced invalid plan 
Provider "registry.terraform.io/clickhouse/clickhouse" planned an invalid 
value for clickhouse_clickpipe.postgres_pipe.destination.managed_table: 
planned value cty.False does not match config value cty.True. 
This is a bug in the provider, which should be reported in the provider's own 
issue tracker. 

Additional context

This same error happens on provider version 3.15.0-alpha1.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions