Closed mcqj closed 1 month ago
Hi @mcqj,
There must be something not shown here, because the error associated with prevent_destroy
don't be shown unless there is actually a destroy or replace operation being planned. This means there must be some pre-existing state which contains the resource you are trying to change, either from a forgotten earlier state, or maybe via an import of the resource. Can you show a complete example of what you are trying to do?
Hi @jbardin Thanks for your prompt response. It is indeed human error on my side. I was creating a new environment and pointing to the incorrect remote state. John
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Version
Terraform Configuration Files
Debug Output
NA
Expected Behavior
Resource should be created.
Actual Behavior
Terraform gave an error saying that the plan called for the resource to be destroyed when prevent_destroy was set to true. In fact, this is the first time running the plan so no resources have ever been created, so the plan should not call for a resource to be deleted when that resource has never been created.
Steps to Reproduce
Use terraform resource to create a dynamo db table with prevent_destroy and run terraform apply.
Additional Context
No response
References
No response