Terraform provisioners allow actions to be performed on local or remote machines to prepare infrastructure for service. There are three built-in provisioners: local-exec runs processes locally, remote-exec runs scripts remotely after resource creation, and chef installs and runs Chef client on remote machines. Provisioners use connection blocks to specify SSH or WinRM connections and override resource defaults.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
55 views6 pages
Terraform Provisioners
Terraform provisioners allow actions to be performed on local or remote machines to prepare infrastructure for service. There are three built-in provisioners: local-exec runs processes locally, remote-exec runs scripts remotely after resource creation, and chef installs and runs Chef client on remote machines. Provisioners use connection blocks to specify SSH or WinRM connections and override resource defaults.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6
Terraform Provisioners
Terraform Provisioners - Introduction
● Provisioners can be used to model specific actions on the local machine or on a remote machine in order to prepare servers or other infrastructure objects for service. ● A connection block nested in a provisioner block only affects that provisioner, and overrides any resource-level connection settings. ● Built-in Provisioners: ○ local-exec ○ remote-exec ○ Chef Provisioners - Local-exec ● The local-exec provisioner invokes a local executable after a resource is created. ● This invokes a process on the machine running Terraform, not on the resource. Provisioners - Remote-exec
● The remote-exec provisioner invokes a script on a remote resource after it is created.
● This can be used to run a configuration management tool, bootstrap into a cluster, etc. ● The remote-exec provisioner supports both ssh and winrm type connections. ● inline - This is a list of command strings. They are executed in the order they are provided. Provisioners - Chef ● The chef provisioner installs, configures and runs the Chef Client on a remote resource. ● The chef provisioner supports both ssh and winrm type connections.
Requirements:
● For ssh type connections, cURL must be available on the remote host.
● For winrm connections, PowerShell 2.0 must be available on the remote host.
● Without these prerequisites, your provisioning execution will fail.