TF-004 Use Terraform outside the core workflow Practice Question
A user wants to see the current state of resources in a human-readable format without making changes. Which command should they use?
⚠ Common exam trap
HashiCorp often tests the distinction between commands that inspect state (`terraform show`, `terraform state list`) versus those that generate plans or modify state, and the trap here is confusing `terraform plan` (which can show proposed changes) with a read-only view of the current state.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
terraform show
`terraform show`, is correct because it displays the current state of managed resources in a human-readable format (defaulting to plain text) without making any changes. This command reads the state file directly and presents its contents, making it ideal for inspection and debugging. Unlike `terraform plan`, it does not generate an execution plan or propose modifications.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
terraform output
Why it's wrong here
The `terraform output` command is specifically designed to display the values of output variables defined in your Terraform configuration. While these outputs often reflect attributes of deployed resources, this command does not provide a comprehensive view of the entire state of all managed resources. It is primarily used for exposing selected, high-level values or connection strings, rather than a detailed inventory of every resource and its current attributes.
- ✗
terraform state list
Why it's wrong here
The `terraform state list` command provides a concise enumeration of all resource addresses currently tracked within the Terraform state file. This command is useful for quickly identifying which resources are under Terraform's management but does not display any of their configuration details or current attribute values. It merely lists the logical names of resources, not their operational state or properties in a human-readable format.
- ✗
terraform plan
Why it's wrong here
The `terraform plan` command generates an execution plan by comparing the desired state defined in your configuration with the actual state of your infrastructure and the recorded state file. Its primary purpose is to show the *changes* Terraform proposes to make, including resources to be added, changed, or destroyed. While it implicitly reads the current state to formulate this plan, it does not directly display the full current state of resources in a human-readable format, focusing instead on the impending modifications.
- ✓
terraform show
Why this is correct
The `terraform show` command is the definitive tool for inspecting the current state of resources managed by Terraform. It reads the `terraform.tfstate` file and presents a detailed, human-readable representation of all tracked resources, including their attributes and their current values. This command is invaluable for auditing, debugging, and understanding the exact configuration of your deployed infrastructure as recorded in the state file.
Go deeper
Related to this question
About these practice questions
This TF-004 question is part of Courseiva's 428-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This TF-004 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-004 exam.