Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 7

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

    Correct Answer: A

    The remote-exec provisioner invokes a script or command on a remote resource after it has been created. This provisioner connects to the remote resource using SSH or WinRM and runs the specified commands directly on that resource. This is different from the local-exec provisioner, which runs commands on the machine where Terraform is being executed, not on the remote resource. Therefore, for invoking a process on a resource created by Terraform, the remote-exec provisioner is the appropriate choice.

Discussion
Cloud9erOption: A

No. Answer is remote-exec. because...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. (this is from the terraform web site)

EltoothOption: A

A is correct answer : remote-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." https://www.terraform.io/language/resources/provisioners/local-exec "The remote-exec provisioner invokes a script on a remote resource after it is created." https://www.terraform.io/language/resources/provisioners/remote-exec

ACE_ASPIRE

This question was in my exam.

BereOption: A

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.

Mal_8Option: A

A is the correct answer : remote-exec

softartsOption: A

I take A remote-exec.

EnirasOption: A

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. See the remote-exec provisioner to run commands on the resource. https://www.terraform.io/language/resources/provisioners/local-exec

090200fOption: A

A is correct ans : "process on the resource" is key point here. so remote-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.

JayanthOption: A

A. remote-exec

Busi57Option: A

remote-exec -> A

Mandeeps468Option: A

A - correct answer : remote-exec

wsyhOption: A

Vote A. local-exec provisioner is execute on the local machine.

Chandru1988Option: A

Definitely Remote-exec

Power123Option: A

A is correct

Zam88Option: A

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. To invoke a local process, see the local-exec provisioner instead. The remote-exec provisioner requires a connection and supports both ssh and winrm. remote-exec correct

subhalaOption: A

I think it is remote-exec, the question is asking about on the resource created by terraform. local-exec runs on the machine where we run terraform.

calebvar

Isn't local exec also correct?

Ahmad_Terraform

Eniras explained well about the Local Exec,