Provisioners can run post deployment tasks like shell commands or scripts when resources like virtual machines are created or destroyed. Provisioners are similar to User Date in AWS, Virtual Machine Extensions in Azure and Cloud Init. It's recommended to use provisioners as a last resort and use a cloud providers build it way of configuring infrastructure.
In this video tutorial I'll go over creating provisioners in a few different ways:
- File provisioner to upload a local file to a remote machine
- local-exec provisioner to execute a shell command where terraform was run
- remote-exec provisioner to execute a shell command on a remote machine
Provisioner Docs:
https://www.terraform.io/docs/provisioners/index.html
Course Examples:
https://github.com/WillBrock/terraform-course-examples