-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Terraform deletion prevention when removing resource from config #3468
Comments
changing to:
will remove terraform_queue from amazon. |
This doesn't directly answer your question, but we have adjusted the IAM of the terraform user so that it is unable to delete resources we never want deleted. |
Thanks for the reply - that is the approach we've taken as well. In fact, even if terraform had an option, we'd likely keep it that way as an extra layer of protection. I just wanted to know if it was intended functionality. |
Would be great if this feature gets implemented at some point! |
I don't really see the point of prevent_destroy if it doesn't prevent this sort of thing. Even with prevent_destroy, your resources will still get destroyed if you terraform apply after: |
So, I have taken a quick look:
|
Potentially duplicated by #17599 |
Guys I would really appreciate if you fix this. |
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. |
Is there a way to prevent the deletion of a resource if it accidentally gets removed from the terraform config? 'prevent_destroy' in the lifecycle block seems to only stop resources from being deleted when their changes require deletion, it doesn't seem to have any effect if you accidentally delete the resource from the config and then apply.
Thoughts?
The text was updated successfully, but these errors were encountered: