Interview Prep/Terraform/Lifecycle, Dependencies, Provisioners and Drift

How do provisioner failures and destroy-time provisioners behave?

AdvancedConceptLifecycle, Dependencies, Provisioners and Drift
Answer

By default a failed provisioner fails the apply and marks the resource tainted, so it is recreated next time. on_failure = continue ignores the error. when = destroy runs before destruction and can reference only the resource's own attributes (via self); if it fails the destroy halts, so they are brittle.

All Terraform questions Roadmap: Terraform in production

More on Lifecycle, Dependencies, Provisioners and Drift