If a schema is deleted from the schema registry then Terraform fails with an error that it cannot find the schema. This is not consistent with resource handling for any other Terraform provider that I have used.
Currently, once deleted from the repository it is then neccessary to delete the corresponding state file entry before Terraform and any CI/CD pipelines can continue.
Terraform should not fail but should continue on to recreate the resource as if it does not exist (which of course it doesn't).
To reproduce:
Delete a schema from the repository
.... use the cli to delete the schema....
Run terraform plan
Result of plan:
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: error reading Schema: error reading Schema "lsrc-xxxxx/fct.price.dynamic.cost-value/latest": error loading the latest Schema: error loading the latest Schema: 404 Not Found: Subject 'fct.price.dynamic.cost-value' not found.
│
│ with confluent_schema.value["autotest-fct.price.dynamic.cost-value"],
│ on schema.tf line 129, in resource "confluent_schema" "value":
│ 129: resource "confluent_schema" "value" {
To recover:
Delete the entry from the state file
terraform state rm 'confluent_schema.value["autotest-fct.price.dynamic.cost-value"]'
Run terraform plan
Result of plan:
Terraform will perform the following actions:
# confluent_schema.value["autotest-fct.price.dynamic.cost-value"] will be created
+ resource "confluent_schema" "value" {
...
If a schema is deleted from the schema registry then Terraform fails with an error that it cannot find the schema. This is not consistent with resource handling for any other Terraform provider that I have used.
Currently, once deleted from the repository it is then neccessary to delete the corresponding state file entry before Terraform and any CI/CD pipelines can continue.
Terraform should not fail but should continue on to recreate the resource as if it does not exist (which of course it doesn't).
To reproduce:
.... use the cli to delete the schema....
Result of plan:
To recover:
Result of plan: