ExamGecko
Question list
Search
Search

Question 85 - Terraform Associate 003 discussion

Report
Export

A developer accidentally launched a VM (virtual machine) outside of the Terraform workflow and ended up with two servers with the same name. They don't know which VM Terraform manages but do have a list of all active VM IDs.

Which of the following methods could you use to discover which instance Terraform manages?

A.
Run terraform state list to find the names of all VMs, then run terraform state show for each of them to find which VM ID Terraform manages
Answers
A.
Run terraform state list to find the names of all VMs, then run terraform state show for each of them to find which VM ID Terraform manages
B.
Update the code to include outputs for the ID of all VMs, then run terraform plan to view the outputs
Answers
B.
Update the code to include outputs for the ID of all VMs, then run terraform plan to view the outputs
C.
Run terraform taint/code on all the VMs to recreate them
Answers
C.
Run terraform taint/code on all the VMs to recreate them
D.
Use terraform refresh/code to find out which IDs are already part of state
Answers
D.
Use terraform refresh/code to find out which IDs are already part of state
Suggested answer: A

Explanation:

The terraform state list command lists all resources that are managed by Terraform in the current state file1.The terraform state show command shows the attributes of a single resource in the state file2. By using these two commands, you can compare the VM IDs in your list with the ones in the state file and identify which one is managed by Terraform.

asked 18/09/2024
Jimmy Wasson
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first