Rationale for Correct Answer (D):terraform state list shows all resources currently managed by Terraform. terraform state show provides detailed attributes, including the VM ID. This lets you match the Terraform-managed instance with the actual infrastructure.
Analysis of Incorrect Options:
A: Importing is not needed since one VM is already in state.
B: terraform apply doesn’t show which VM ID is managed, it only refreshes attributes.
C: Removing state entries is destructive and may lead to losing state data unnecessarily.
Key Concept:The state file is Terraform’s source of truth for which resources it manages.
[Reference:Terraform Exam Objective – Implement and Maintain State., ]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit