exam questions

Exam 1z0-1067-21 All Questions

View all questions & answers for the 1z0-1067-21 exam

Exam 1z0-1067-21 topic 1 question 25 discussion

Actual exam question from Oracle's 1z0-1067-21
Question #: 25
Topic #: 1
[All 1z0-1067-21 Questions]

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 answer.)

  • A. Terraform modules
  • B. Terraform remote state
  • C. Terraform local-exec
  • D. Terraform remote-exec
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
pabloinigo
Highly Voted 3 years, 7 months ago
Solution is C https://www.terraform.io/docs/language/resources/provisioners/local-exec.html resource "aws_instance" "web" { # ... provisioner "local-exec" { command = "echo ${self.private_ip} >> private_ips.txt" } }
upvoted 11 times
antoweb
3 years, 5 months ago
The local-exec runn script in the machine running terraform and not to remote resource. The answer should b remote-exec https://www.terraform.io/docs/language/resources/provisioners/remote-exec.html
upvoted 10 times
timbuchinger
3 years, 3 months ago
The question is asking for you to write it to your local laptop where Terraform is running, so local-exec is the correct answer.
upvoted 4 times
IT_Thinker
3 years, 3 months ago
Remote-Exec: The question clearly states "spinning up multiple compute instances in Oracle Cloud Infrastructure (OCI) for a project". Eventhough TF is running on the laptop, the instances are located in OCI. The laptop is "remote" from the OCI instances.
upvoted 2 times
...
...
...
...
subhradip
Most Recent 3 years, 2 months ago
it's D
upvoted 1 times
...
JoaoGaiola
3 years, 2 months ago
Selected Answer: D
It's D, you will invoke the command on the resource not on the machine running terraform https://www.terraform.io/language/resources/provisioners/remote-exec https://www.terraform.io/language/resources/provisioners/local-exec
upvoted 1 times
...
jexam211
3 years, 2 months ago
Selected Answer: C
When you execute terraform script you use your local machine (and if you have the required policies) and modify remote and if you want an output inside you use local-exec, cause if you use remote the output will save inside the remote machine
upvoted 1 times
...
jexam211
3 years, 3 months ago
Selected Answer: C
https://www.devopsschool.com/blog/understanding-local-exec-provisioner-in-terraform/ https://www.terraform.io/language/resources/provisioners/local-exec if we want execute a script in the local we need to use local-exec
upvoted 1 times
...
JBvino
3 years, 4 months ago
Selected Answer: D
looks close to be answer
upvoted 2 times
...
imiimran
3 years, 5 months ago
A is the answer
upvoted 1 times
...
jesselca96
3 years, 5 months ago
justify me, why the aswer is the C
upvoted 1 times
...
akr14feb
3 years, 5 months ago
D looks close
upvoted 1 times
...
reachabhien10
3 years, 8 months ago
How is A?
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago