1Z0-1067-25 practice question 13 of 15
You are working with Terraform on your laptop and have been tasked with spinning up multiple compute instances in Oracle Cloud Infrastructure (OCI) for a project. In addition, you are also required to collect IP addresses of provisioned instances and write them to a file and save it in your laptop. Which specific Terraform functionality can help accomplish this task? (Choose the best)
Full set: 93 questionsThe requirement is to perform an action on the local machine (the laptop running Terraform) after a resource is created in OCI. The local-exec provisioner is designed for this exact purpose. It invokes a local executable after a resource is created or destroyed. In this scenario, it can be used to run a script that takes the IP addresses of the newly created instances as input and writes them to a local file. This happens on the machine where the terraform apply command is executed.
A. The remote-exec provisioner runs scripts on the remote resource that Terraform creates (e.g., on the new compute instance), not on the local machine.
B. Terraform remote state is a feature for storing the state file in a shared, remote location, which is unrelated to executing local scripts.
C. Terraform modules are reusable packages of Terraform configurations for creating and managing resources, not for executing local commands post-provisioning.
1. HashiCorp Terraform Documentation, "Provisioners - local-exec". The documentation states, "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."
2. HashiCorp Terraform Documentation, "Provisioners". The overview explains the difference between local and remote provisioners, clarifying that local-exec is for actions on the control machine.
Keep practicing
Take the free 1Z0-1067-25 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1Z0-1067-25 practice questions
- Question 2Which statement is incorrect regarding replication being turned ON for a bucket named my-…
- Question 4You set up a bastion host in your Virtual Cloud Network (VCN) to allow only your IP ad-dr…
- Question 6Which option is NOT a possible return value for an OCI health check?
- Question 7Which default authentication is used by Ansible modules for Oracle Cloud Infrastructure (…
- Question 8You have created several block volumes in the us-phoenix-1 region in a specific compart-m…
- Question 9Security Testing Policy describes when and how you may conduct certain types of security …
