TA-002-P · Question #139
What is the purpose of using the local-exec provisioner? (Select Two)
The correct answer is A. To invoke a local executable. C. To execute one or more commands on the machine running Terraform. The local-exec provisioner runs commands on the local machine where Terraform is being executed - not on the remote resource. It is used to invoke local executables or run local scripts as part of resource creation. Option B is incorrect because local-exec does not execute…
Question
What is the purpose of using the local-exec provisioner? (Select Two)
Options
- ATo invoke a local executable.
- BExecutes a command on the resource to invoke an update to the Terraform state.
- CTo execute one or more commands on the machine running Terraform.
- DEnsures that the resource is only executed in the local infrastructure where Terraform is
How the community answered
(38 responses)- A87% (33)
- B5% (2)
- D8% (3)
Explanation
The local-exec provisioner runs commands on the local machine where Terraform is being executed - not on the remote resource. It is used to invoke local executables or run local scripts as part of resource creation. Option B is incorrect because local-exec does not execute commands on the remote resource (that is remote-exec's role). Option D is incorrect because local-exec is not restricted to 'local infrastructure' - it runs wherever the Terraform CLI is running, regardless of where resources are deployed.
Topics
Community Discussion
No community discussion yet for this question.