-
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
Bypass CreateBeforeDestroyTransformer on terraform destroy #5096
Bypass CreateBeforeDestroyTransformer on terraform destroy #5096
Conversation
763534e
to
4a22ac5
Compare
👍 |
1 similar comment
👍 |
@catsby does this look good to you guys? |
@phinze We're also running into this issue and would love to see this fix (or something similar) be included in the next terraform release. |
LGTM - I have another full-stack test I just wrote to exercise this that I'll add on master and link back here. |
…troy_bypass Bypass CreateBeforeDestroyTransformer on terraform destroy
@phinze Awesome! Looking forward to this being released! ❤️ |
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. |
Reference: #3294, #2493, #2359, possibly others.
This patch ensures that create_before_destroy is ignored during a
terraform destroy
operation by ensuring its graph transformer does not get added at all. IfDestroy
is true (ultimately passed in through context), it just gets skipped.This ensures that this is not even considered during a destroy operation (where destroying resources is the only thing that makes sense), versus a replacement operation (where if you have specified
create_before_destroy
, you obviously want it).Also, I have included a couple of simple tests that ensures the presence/non-presence of the transformer appropriately.