confluentinc / terraform-provider-confluent

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

#235 Reopen #284

Open AlexVasiukov opened 1 year ago

AlexVasiukov commented 1 year ago
          > The issue has been resolved in [version 1.46.0](https://github.com/confluentinc/terraform-provider-confluent/blob/master/CHANGELOG.md#1460-june-23-2023), which has been released on June 26th.

cc @AlexVasiukov

@linouk23 , thanks for the feedback! I just tested the current release (1.47) and, as I understood correctly, the issue wasn't completely resolved, but was patched to move the current check from terraform apply to terraform plan (as was suggested in #218). So, now we have an error while trying to plan some incompatible change in schema version with recreate_on_update flag set to true:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: error updating Schema "lsrc-3nwd2j/avas-schema1-value/100003": reimport the current resource instance and set recreate_on_update = false to evolve a schema using the same resource instance.
│ In this case, on an update resource instance will reference the updated (latest) schema by overriding schema_identifier, schema and version attributes and the old schema will be orphaned.
│
│   with confluent_schema.avas-schema1-value-3,
│   on main.tf line 164, in resource "confluent_schema" "avas-schema1-value-3":
│  164: resource "confluent_schema" "avas-schema1-value-3" {

I doubt that this behavior is most expected. To my mind, the expected behavior is to recreate the current resource by deleting it and creating again and re-point schema_identifier to the new resource (and the old schema will be orphaned, just like it was mentioned in the error message above). I understand, that this behavior couldn't be done for the current major version. Perhaps, it's possible to redone this behavior in the next major, isn't it?

Originally posted by @AlexVasiukov in https://github.com/confluentinc/terraform-provider-confluent/issues/235#issuecomment-1614994381

AlexVasiukov commented 9 months ago

Are there any updates regarding this topic?