TF-004 Use the core Terraform workflow Practice Question
A user runs 'terraform plan' and it shows 'No changes. Infrastructure is up-to-date.' However, the user knows they added a new resource block to the configuration. What could explain this?
⚠ Common exam trap
HashiCorp often tests the subtle behavior of `count = 0` causing a resource to be completely ignored by Terraform, leading candidates to mistakenly think the resource would still appear in the plan as 'to be added' or that other workflow commands like `validate` or `fmt` are responsible for the discrepancy.
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
✓
The resource block has a count parameter set to 0.
When a resource block has `count = 0`, Terraform evaluates the count meta-argument and determines that zero instances of that resource should be created. As a result, the resource is effectively absent from the state, and `terraform plan` sees no changes because there is nothing to add, modify, or remove. This is a common cause of a 'No changes' result despite adding a new resource block.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The resource block has a count parameter set to 0.
Why this is correct
The `count` meta-argument in a resource block controls the number of identical resource instances Terraform should manage. When `count` is explicitly set to `0`, Terraform is instructed to manage zero instances of that specific resource. Consequently, if the resource does not currently exist in the state, `terraform plan` will show no changes because it is not intended to be created. If the resource *did* exist, setting `count` to `0` would cause `terraform plan` to propose its destruction.
- ✗
The resource block is inside an output block.
Why it's wrong here
Terraform configurations have a defined structure where `resource` blocks and `output` blocks serve distinct purposes and cannot be arbitrarily nested. A `resource` block defines infrastructure components, while an `output` block exposes values from the infrastructure. Attempting to place a `resource` block inside an `output` block would result in a syntax error during `terraform validate` or `terraform plan`, preventing any plan from being generated, rather than showing "no changes infra."
- ✗
The user ran terraform validate before plan.
Why it's wrong here
The `terraform validate` command performs static analysis of configuration files, checking for syntax errors, correct argument types, and valid provider configurations. It does not interact with the remote state or actual infrastructure, nor does it influence Terraform's understanding of the desired state. Therefore, running `terraform validate` before `terraform plan` has no bearing on whether `terraform plan` detects infrastructure changes; it merely confirms the configuration's structural integrity.
- ✗
The resource block was added after running terraform fmt.
Why it's wrong here
The `terraform fmt` command is a purely cosmetic utility designed to rewrite Terraform configuration files to a canonical format and style. Its sole purpose is to improve readability and maintain consistency across codebases. `terraform fmt` does not modify the semantic meaning of the configuration, nor does it interact with the Terraform state or infrastructure. Consequently, running `terraform fmt` has absolutely no effect on the outcome of `terraform plan` or whether changes are detected.
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.