Overview - Why provisioners run scripts on resources
What is it?
Provisioners in Terraform are tools that let you run scripts or commands on resources after they are created or before they are destroyed. They help customize or configure resources beyond what Terraform can do by itself. This means you can automate setup tasks like installing software or changing settings on servers. Provisioners act as a bridge between Terraform and the resource's internal setup.
Why it matters
Without provisioners, Terraform would only create resources but not configure them fully. This would mean manual work or separate tools to finish setup, causing delays and errors. Provisioners solve this by automating configuration right after resource creation, making infrastructure ready to use immediately. This saves time, reduces mistakes, and ensures consistent setups across environments.
Where it fits
Before learning about provisioners, you should understand basic Terraform resource creation and lifecycle. After mastering provisioners, you can explore configuration management tools like Ansible or Chef, and advanced Terraform features like modules and remote-exec connections.