Which provisioner runs commands on the local machine where Terraform is executed during apply?

Prepare for the HashiCorp Terraform Associate Exam. Utilize flashcards and multiple-choice questions with detailed hints and explanations. Boost your confidence and be ready for success!

Multiple Choice

Which provisioner runs commands on the local machine where Terraform is executed during apply?

Explanation:
Provisioners perform actions after a resource is created, and they run where Terraform directs them. The one that executes commands on the machine where you run Terraform is local-exec. It runs the specified command locally during apply, which makes it ideal for tasks that need to happen on your workstation or in your local environment. In contrast, remote-exec runs commands on the remote resource over SSH/WinRM, and the file provisioner copies files to the remote host (often followed by remote commands). There isn’t a standard provisioner named null-exec. So, the local-exec provisioner is the one that runs commands on the local machine during apply.

Provisioners perform actions after a resource is created, and they run where Terraform directs them. The one that executes commands on the machine where you run Terraform is local-exec. It runs the specified command locally during apply, which makes it ideal for tasks that need to happen on your workstation or in your local environment. In contrast, remote-exec runs commands on the remote resource over SSH/WinRM, and the file provisioner copies files to the remote host (often followed by remote commands). There isn’t a standard provisioner named null-exec. So, the local-exec provisioner is the one that runs commands on the local machine during apply.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy