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.
More on Lifecycle, Dependencies, Provisioners and Drift
What are meta-arguments?BeginnerWhat lifecycle options are available?BeginnerHow does `create_before_destroy` work and what can go wrong?AdvancedWhat does `prevent_destroy` guarantee and what does it not?AdvancedWhen do you use `ignore_changes`?IntermediateWhat does `replace_triggered_by` do?Advanced