nerdexam
HashiCorp

TA-002-P · Question #7

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

The correct answer is A. remote-exec. The remote-exec provisioner runs scripts or commands directly on the remote resource that Terraform just created (e.g., a VM), connecting via SSH or WinRM. In contrast, local-exec runs commands on the machine where Terraform itself is executing, not on the provisioned resource. T

Understand Terraform basics

Question

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

Options

  • Aremote-exec
  • Bnull-exec
  • Clocal-exec
  • Dfile

How the community answered

(62 responses)
  • A
    94% (58)
  • B
    2% (1)
  • C
    2% (1)
  • D
    3% (2)

Explanation

The remote-exec provisioner runs scripts or commands directly on the remote resource that Terraform just created (e.g., a VM), connecting via SSH or WinRM. In contrast, local-exec runs commands on the machine where Terraform itself is executing, not on the provisioned resource. The file provisioner copies files to the remote resource but does not execute them. null-exec is not a real Terraform provisioner.

Topics

#Provisioners#remote-exec#Resource lifecycle

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice