When running terraform destroy, a network peering status will be set to “Defunct”, and terraform thinks the peering is deleted. As a result, the process is unable to destroy the network and the project as well. Whilst “destroy” may not be a commonly-needed function, the ability to change parameters that require recreation would also be affected.
Hi @Benjamin_Boyle could you make this an issue in the terraform repository ?
This would help a lot https://github.com/EventStore/terraform-provider-eventstorecloud
Can you also provide
- version of eventstore provider and terraform version
- steps to reproduce
@Benjamin_Boyle there was a bug in 1.5.6 (I think) version. To be honest, it’s my fault. When migrating to Terraform plugin SDK 2.0, some types became n/a and the provider metadata result was wrongly typed. It has been fixed in later versions, but the TF of the peering state became incompatible.
It should not happen again.
Hi @Benjamin_Boyle. I discovered the provider was erroneously checking for defunct states initially during a destroy and returning an error, preventing it from deleting these resources. I’ve submitted a fix for the provider and will cut a release soon. Thanks for finding this bug.
@alexey.zimarev Thankfully the fix for the issue you described added code to make it backwards compatible with all prior terraform state files. I don’t believe it was related to this issue destroying defunct resources.