From the course: Developing Infrastructure as Code with Terraform

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Provisioners

Provisioners

- Provisioners are a legacy feature of Terraform, and they, they sort of blur the lines between infrastructure s-code and configuration management. So the use case originally was that you could do things like create a virtual machine and then have Terraform SSH into it or run Ansible or you know, puppet or something like that in order to configure that VM once it was up and running. HashiCorp recommends against using Provisioners for the most part, but they can be handy. So, sort of the most common use case that I see now is to use this local exec provisioners. So there are a number of different provisioners. There's an SSH provisioner, there's an Ansible provisioner, and those do still exist. This one is the one that I see used most commonly. And so, what we're doing here in this example is we're creating what's called a null resource. So this is a resource that doesn't do anything. It doesn't create anything, and we're just using it to run a shell script. So in this case, we're just…

Contents