TF-004 Use the core Terraform workflow Practice Question
A developer has written Terraform configuration for a new web server. They want to preview the changes that Terraform will make without actually creating any resources. Which command should they run?
⚠ Common exam trap
A common mix-up: candidates confuse terraform plan with terraform validate, thinking that validate also previews changes, when it only checks configuration validity.
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 plan
The terraform plan command is used to create an execution plan, showing what Terraform will do without making any changes. It is the standard way to preview infrastructure modifications. Other commands like apply make changes, validate only checks syntax, and refresh updates state but does not preview new resources.
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 refresh
Why it's wrong here
terraform refresh updates the state file to match the real infrastructure, but it does not show a plan of changes. It can detect drift, but it will not tell the developer what new resources would be created. It also modifies the state, so it is not a safe preview command.
- ✗
terraform validate
Why it's wrong here
terraform validate checks whether the configuration is syntactically valid and internally consistent, but it does not compare the configuration to the current state or show any planned changes. It is useful for catching errors early, but it does not provide a preview of resource creation or modification.
- ✗
terraform apply
Why it's wrong here
terraform apply will create or modify resources to match the configuration. It may show a plan and prompt for approval, but it ultimately makes changes to real infrastructure. The developer wants only a preview, so this command does not meet the requirement and could incur costs or unintended modifications.
- ✓
terraform plan
Why this is correct
terraform plan performs a dry run that shows what actions Terraform would take to reach the desired state. It does not modify any infrastructure. This is exactly what the developer needs to preview changes safely before deciding to apply them, making it the correct command for this scenario.
Go deeper
Related to this question
About these practice questions
This TF-004 question is part of Courseiva's 434-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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official HashiCorp exam blueprint
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.