Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
HashiCorp Certified: Terraform Associate (003) · HashiCorp
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
The remote-exec provisioner connects to the resource created by Terraform (like a virtual machine) and executes scripts or commands directly on it. It's often used for tasks like installing software, running configuration management agents, or bootstrapping an application on the new resource.
The remote-exec provisioner is the one that invokes a process on the resource created by Terraform, running commands or scripts on the remote machine after it has been provisioned.
The remote-exec provisioner invokes a script on a remote resource created by Terraform. It connects to the resource using SSH or WinRM and runs the provided inline or script commands. Here's an example of how you might use it: resource "aws_instance" "example" { ami = "ami-0c94855ba95c574c8" instance_type = "t2.micro" provisioner "remote-exec" { inline = [ "echo Hello, World! > /home/ubuntu/hello", "chmod +x /home/ubuntu/hello", ] } } There's no null-exec provisioner in Terraform. The local-exec provisioner invokes a local executable after a resource is created. It runs on the machine where Terraform is being executed. The file provisioner is used to copy files or directories from the machine executing Terraform to the newly created resource.