As a member of the operations team, you need to run a script on a virtual machine created by Terraform. Which provision is best to use in your Terraform code?
As a member of the operations team, you need to run a script on a virtual machine created by Terraform. Which provision is best to use in your Terraform code?
To run a script on a virtual machine created by Terraform, the remote-exec provisioner is the best choice. The remote-exec provisioner allows you to execute commands or scripts on a remote resource, which is suitable for configuring the virtual machine after its creation.
remote-exec to run anything on the deployed virtual machine. local exec is to run anything on the system where terraform is running
thanks mate
The remote-exec provisioner invokes a script on a remote resource after it is created. To invoke a local process, see the local-exec provisioner instead. Source: https://www.terraform.io/language/resources/provisioners/remote-exec
On a VM , it is a remote-exec.
remote-exec all day
VM is not local, I go with remote, C
C- remote-exec is the correct answer If you need to run a script on a virtual machine created by Terraform, the remote-exec provisioner is the best choice. The remote-exec provisioner allows you to run commands or scripts on a remote machine, which is especially useful for configuring and provisioning resources after they have been created.
Source: https://www.terraform.io/language/resources/provisioners/remote-exec
c is the correct answer