Which provisioner invokes a process on the resource created by Terraform?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Which provisioner invokes a process on the resource created by Terraform?

Explanation:
Commands can be run in two contexts with Terraform provisioners: on the machine running Terraform or on the resource that was just created. The remote-exec provisioner connects to the newly created resource (for example via SSH or WinRM) and executes the specified commands there, which means it directly invokes a process on that resource. Local-exec runs commands on the local machine that runs Terraform, not on the target resource. The file provisioner transfers files to the remote resource but doesn’t by itself run a command on it. There isn’t a real provisioner named null-exec. So the one that truly invokes a process on the resource itself is remote-exec.

Commands can be run in two contexts with Terraform provisioners: on the machine running Terraform or on the resource that was just created. The remote-exec provisioner connects to the newly created resource (for example via SSH or WinRM) and executes the specified commands there, which means it directly invokes a process on that resource. Local-exec runs commands on the local machine that runs Terraform, not on the target resource. The file provisioner transfers files to the remote resource but doesn’t by itself run a command on it. There isn’t a real provisioner named null-exec. So the one that truly invokes a process on the resource itself is remote-exec.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy