Which provisioner invokes a process on the resource created by Terraform?
Which provisioner invokes a process on the resource created by Terraform?
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.
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)
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
This question was in my exam.
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.
A is the correct answer : remote-exec
I take A 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. See the remote-exec provisioner to run commands on the resource. https://www.terraform.io/language/resources/provisioners/local-exec
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.
A. remote-exec
remote-exec -> A
A - correct answer : remote-exec
Vote A. local-exec provisioner is execute on the local machine.
Definitely Remote-exec
A is correct
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
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.
Isn't local exec also correct?
Eniras explained well about the Local Exec,