Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting schema from registry should not cause teraform to fail #453

Open
Noel-Jones opened this issue Oct 10, 2024 · 0 comments
Open

Deleting schema from registry should not cause teraform to fail #453

Noel-Jones opened this issue Oct 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Noel-Jones
Copy link

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:

  1. Delete a schema from the repository

.... use the cli to delete the schema....

  1. 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:

  1. Delete the entry from the state file
terraform state rm 'confluent_schema.value["autotest-fct.price.dynamic.cost-value"]'
  1. 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" {
...
@linouk23 linouk23 added the bug Something isn't working label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants