Which Terraform command lets you view all attributes and details of a managed resource?

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 Terraform command lets you view all attributes and details of a managed resource?

Explanation:
To see all attributes of a specific managed resource, use the state show command. It reads the current state and prints every attribute for the given resource address, including computed values and the resource ID. For example, terraform state show aws_instance.web_server would display the full details Terraform knows about that instance. This is why it’s the best choice: it targets a single resource and dumps its complete state. The other state-related commands serve different purposes: listing shows all resource addresses in state, fetching the state from a backend, or displaying the entire state or a plan, rather than focusing on the full details of one resource.

To see all attributes of a specific managed resource, use the state show command. It reads the current state and prints every attribute for the given resource address, including computed values and the resource ID. For example, terraform state show aws_instance.web_server would display the full details Terraform knows about that instance. This is why it’s the best choice: it targets a single resource and dumps its complete state.

The other state-related commands serve different purposes: listing shows all resource addresses in state, fetching the state from a backend, or displaying the entire state or a plan, rather than focusing on the full details of one resource.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy