Terraform Provisioners | Run Init script on VM

preview_player
Показать описание
This is one of the videos from the course in udemy, if you would like to learn more about terraform please find the link to the course below:

Provisioners provide the ability to run additional steps or tasks when a resource is created or destroyed. This is not to be confused as a replacement for configuration management. Tools like Chef, Puppet, and Ansbile are much better suited for configuration management and it's best to leave the heavy lifting to those tools. Provisioners are used to fill the gaps in between.

Provisioners can be tied to a resource which causes them to run after that resource has been successfully created. There are several provisioner types that allow for various actions to be taken such as copying a file to a resource, remotely executing a script or command, as well a locally executing a command or script on the endpoint that is running the terraform code. There are also provisioner types that are specifically meant for configuration management tools like Chef, Puppet, and Saltstack. Provisioners are created with a provisioner resource block followed by a provisioner type in the first parameter string. Below is an example of a provisioner block using the file provisioner type to copy a PowerShell script to the deployed resource. Inside the provisioner block is a connection block. This is used to define how to connect to the resource, in the example winrm is used but we could also do SSH as well:
Рекомендации по теме
Комментарии
Автор

Hello Shan, thanks for the video.

One quick question how we can achieve restart and resume in terraform along with this?

like I have to install IIS feature and do restart. then proceed to deploy application. Any thoughts? would be appreciated. Thank you.

dannotes
Автор

can you do a video on condition checks(pre and post conditions) of data source and resources

wastefellow
Автор

How to run the shell scripts in one gofor multiple servers without using ansible..any alternative please

sandeepsahu
Автор

Can you please share the git repo path? And I'm unable to find your course on Udemy

rachit