-
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
core: prevent_destroy does not prevent destroy when caused by reducing the count #5826
Comments
Hey @Gary-Armstrong thanks for writing in. The core problem here is that |
Thanks @catsby. Are you clarifying that |
I'm clarifying that I've re-titled this issue and it should get picked up with other core work. There's another issue regarding Thanks again! |
Verified this is broken with a test. Working on it now. |
Fixes #5826 The `prevent_destroy` lifecycle configuration was not being checked when the count was decreased for a resource with a count. It was only checking when attributes changed on pre-existing resources. This fixes that.
Fixes hashicorp#5826 The `prevent_destroy` lifecycle configuration was not being checked when the count was decreased for a resource with a count. It was only checking when attributes changed on pre-existing resources. This fixes that.
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. |
I do not know if this is a documentation bug or a TF bug or a bug in my expectations.
The situation is that I'm using instance count variables to create/destroy instances. I also am working hard on finding a way to have EIPs persist during instance termination. Well,
prevent_destroy = true
seems like what I want. Also due to that "diffs don't match" issue, I feel likeignore_changes
is also great for me.So I did this:
I already have 5 test instances. When I plan on reducing to 2 test instances:
This isn't what I expected; the EIP are still being destroyed.
Where does this issue lie? Me, or TF, or the docs?
The text was updated successfully, but these errors were encountered: