-
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
Tainted null_resource
with destroy provisioner
does not run the destroy command.
#14403
Comments
Destroy provisioners neither run if null_resource is removed or commented out from the |
That would be great indeed, I worked around the issue by putting by destroy provisioner on "real" resources that are destroyed along with my |
+1 |
Since it's been a while, I can confirm that this is still happening on version 0.11.1. |
+1 |
2 similar comments
+1 |
+1 |
+1 |
Please do not post "+1" comments, since they just create noise for those monitoring this issue and don't contribute to prioritization (because we can't report on them). Instead, leave a 👍 reaction on the original comment of this issue, which we can and do report on as an input to prioritization. |
This issue doesn't seem to be limited to just the |
Have we gotten any traction on this? I also have the same problem as @scross01 and @zhaohanweng. Suppose instead of using taint, I used a terraform destroy -target=xxx, but this is also destroying the dependent resources connected to the target xxx. I want the ability to be able to either taint specific resources and have my on destroy "remote-exec" run when I do plan and apply or the ability to destroy just specific resources using -target. How can I go about this? |
I'm using |
Is there any traction in on this issue? I feel like destroy provisioner information should be stored in the state to resolve this. |
Use case that is causing issues for me is an on-destroy local-exec that needs to be triggered when a generic resource type is destroyed via GitOps based workflow (config dropped). |
Definitely what our team needs too! We expected to use null_resource with local provisioner as a cleanup script for another resource (which creates physical files but does not delete them if destroyed) |
Just wondering if there is any plan to fully support taint on null_resource with destroy time provisioner ? This issue is there for almost 4 years |
Hi all, This isn't an issue with any particular resource type or provider, and is instead an artifact of the design of destroy-time provisioners, which in current Terraform are really only for situations where an object is being destroyed as part of either a full destroy ( We've been using #13549 as an umbrella issue for all of these feature requests for destroy-time provisioners to be run in more situations, and so I'm going to close this one just to consolidate the discussion over there. We are currently only really maintaining the behavior of provisioners as they currently exist and not investing further in the concept, because provisioners are a last resort. However, we'll keep the other issue open to track the underlying use-case for whatever mechanisms will eventually replace all of the remaining reasons to use provisioners. If you upvoted here and are still interested in this, please transfer your upvote to #13549. Thanks! |
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. |
Hi there,
I am using
destroy
provisioner onnull_resource
, this works great onterraform destroy
. When I try to taint this resource and re-apply, the destroy script does not run. Is this expected?Terraform Version
Terraform v0.9.5
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
The
destroy
provisioner should run when the resource is tainted, and re-applied.Actual Behavior
The
destroy
provisioner did not run.Steps to Reproduce
terraform taint null_resource.test2_add_group_role
terraform plan
terraform apply
The text was updated successfully, but these errors were encountered: