confluentinc / terraform-provider-confluent

Terraform Provider for Confluent
Apache License 2.0
31 stars 64 forks source link

Schema version is not updated properly with schema_reference #269

Open rocioemera opened 1 year ago

rocioemera commented 1 year ago

Confluent provider version: 1.43

I am making use us confluent_schema resource to create the schemas subjects. The schema_b makes reference to schema_a . When i made a change in schema_a, the schema_b object is not updated with the new version of schema_a. I have to run the pipeline again in order to terraform update the schema_b to use the latest version o schema_a

Terraform code

resource "confluent_schema" "schema_a" {
  subject_name = "schema_a"
  format       = "AVRO"
  schema       = file("${var.avro_base_path}/SlotId.avsc")
}

data "confluent_schema" "schema_a" {
  subject_name      = confluent_schema.schema_a.subject_name
  schema_identifier = confluent_schema.schema_a.schema_identifier
}

resource "confluent_schema" "schema_b" {
  subject_name = "schema_b"
  format       = "AVRO"
  schema       = file("${var.avro_base_path}/AdjustOnHandBalanceDetails.avsc")

  schema_reference {
    name         = "com.grainger.keepstock.tasks.events.SlotId"
    subject_name = data.confluent_schema.schema_a.subject_name
    version      = data.confluent_schema.schema_a.version
  }
}

I expect that using the the references will cause schema_b to be updated together with a

Ramguru94 commented 3 weeks ago

any luck on this ?