TF-004 Use the core Terraform workflow Practice Question
A developer runs terraform plan and sees that a resource will be destroyed. They want to confirm the exact cause of the destruction before applying. What should they do?
⚠ Common exam trap
HashiCorp often tests the distinction between commands that inspect the plan (`terraform show`) versus commands that validate syntax (`terraform validate`) or visualize dependencies (`terraform graph`), leading candidates to confuse planning-phase diagnostics with configuration checks.
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
✓
Run terraform show after plan.
Running `terraform show` after `terraform plan` displays the plan output in a human-readable format, including the full set of changes (create, update, destroy) and the attributes that triggered them. This allows the developer to inspect the exact reason a resource is marked for destruction, such as a changed required argument or a removed configuration block. It is the standard way to review plan details without applying.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Run terraform show after plan.
Why this is correct
After running `terraform plan -out=tfplan`, executing `terraform show tfplan` is the definitive method to inspect the proposed changes in detail. This command renders the plan file in a human-readable format, explicitly listing each resource modification, including creations, updates, and destructions. Crucially, for destructive changes, it often indicates the specific attribute modifications that necessitate resource replacement or deletion, providing the "why" behind the planned action.
- ✗
Review the state file directly.
Why it's wrong here
Directly reviewing the `terraform.tfstate` file is an unreliable and error-prone approach for understanding a plan's intent. The state file represents the *current* known state of managed infrastructure, not the *proposed* changes or the rationale behind them. It lacks the comparison logic and diffing capabilities that Terraform's planning engine provides, making it impossible to discern why a resource might be slated for destruction based solely on its contents.
- ✗
Run terraform validate.
Why it's wrong here
Running `terraform validate` serves a distinct purpose: it checks the configuration files for syntax errors, argument type mismatches, and internal consistency within the Terraform language. This command operates purely on the configuration itself, without interacting with the state file or cloud providers. Therefore, `terraform validate` cannot interpret or explain the outcomes of a `terraform plan`, such as why a resource is scheduled for destruction, as it does not perform any state-to-configuration comparison.
- ✗
Run terraform graph.
Why it's wrong here
The `terraform graph` command generates a visual representation of the dependency graph for your infrastructure resources. While invaluable for understanding the order in which resources will be created, updated, or destroyed, it does not provide any information about the *nature* of the planned changes or the *reasons* for them. It illustrates relationships, not the attribute-level differences or the specific triggers for a resource's destruction.
Go deeper
Related to this question
About these practice questions
Courseiva writes every TF-004 question from scratch — 428 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.