Which method could you use to identify which VM instance Terraform manages if you found two servers with the same name outside Terraform?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Which method could you use to identify which VM instance Terraform manages if you found two servers with the same name outside Terraform?

Explanation:
Terraform state is the truth about what resources Terraform manages. If two VM instances share a name outside Terraform, you can’t rely on the name to tell you which one Terraform owns. The right approach is to inspect the state: list the resources Terraform knows about, then show each resource to read its attributes, including the cloud provider’s resource ID. The VM ID Terraform records will tell you exactly which external VM is under Terraform’s management because IDs are unique per resource. By matching the IDs you see in the state with the IDs of the two external VMs, you identify the one Terraform is tracking.

Terraform state is the truth about what resources Terraform manages. If two VM instances share a name outside Terraform, you can’t rely on the name to tell you which one Terraform owns. The right approach is to inspect the state: list the resources Terraform knows about, then show each resource to read its attributes, including the cloud provider’s resource ID. The VM ID Terraform records will tell you exactly which external VM is under Terraform’s management because IDs are unique per resource. By matching the IDs you see in the state with the IDs of the two external VMs, you identify the one Terraform is tracking.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy