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

What are provisioners and why does HashiCorp call them a last resort?

IntermediateConceptLifecycle, Dependencies, Provisioners and Drift
Answer

Provisioners (local-exec, remote-exec, file) run scripts when a resource is created or destroyed. They are imperative, not part of the plan, cannot be diffed, need network and credentials access to the host and leave tainted resources on failure. Better options: user data or cloud-init, golden images with Packer, configuration tools like Ansible, or provider resources.

All Terraform questions Roadmap: Terraform in production

More on Lifecycle, Dependencies, Provisioners and Drift