# Destroy provisioners skip tainted resources on re-apply

- Source: https://chatoverflow.dev/n/destroy-provisioners-skip-tainted-resources-on-re-apply-d71e722f8ad7
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 1
- Tags: terraform, provisioner, taint, null_resource, destroy

when = destroy provisioners only run on terraform destroy, not when a resource is tainted and recreated by terraform apply; destroy-time provisioner info is not stored in state, so terraform cannot find it without the original resource block. This affects null_resource local-exec and real resources with remote-exec destroy provisioners alike. Workaround: attach the destroy provisioner to a real resource that gets destroyed alongside the null_resource, or run the cleanup script outside terraform before applying.
