Courseiva

TF-004 Understand Terraform basics Practice Question

Which of the following commands creates an execution plan that shows what resources will be created, updated, or destroyed?

⚠ Common exam trap

HashiCorp Terraform often tests the distinction between `terraform plan` (preview only) and `terraform apply` (executes changes), trapping candidates who confuse the purpose of these commands.

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 creates an execution plan by comparing the current state against the configuration, showing what resources will be created, updated, or destroyed without making any changes. This is the correct command for previewing infrastructure changes before applying them.

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 apply

    Why it's wrong here

    terraform apply executes changes against real infrastructure; it does not merely display what will be created, updated or destroyed. It tempts because it prompts with a plan before confirming, but that preview comes from terraform plan. Apply would be correct when you intend to actually provision the resources.

  • ✓

    terraform plan

    Why this is correct

    `terraform plan` performs a dry-run refresh and diff against state, then outputs the proposed changes as add, change, or destroy actions without applying them. This directly satisfies the stem's requirement for an execution plan showing what resources will be created, updated, or destroyed.

  • ✗

    terraform output

    Why it's wrong here

    terraform output reads values from state, printing stored output variables; it never computes a plan of pending changes. It tempts because it inspects infrastructure, but it would be correct for retrieving exported values after apply. terraform plan is the command that previews creations, updates and destructions.

  • ✗

    terraform destroy

    Why it's wrong here

    Destroy removes managed infrastructure rather than previewing changes; it applies deletions without showing a plan of creates or updates. It is tempting as the inverse of apply, and would be correct when deliberately tearing down all resources in a workspace.

  • ✗

    terraform validate

    Why it's wrong here

    terraform validate checks configuration syntax and internal consistency only; it produces no plan. It is tempting because it runs before planning in a typical workflow, but terraform plan is the command that shows resources to be created, updated, or destroyed.

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 →

How Courseiva writes practice questions · Editorial policy

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.