TF-Associate-004 - Core Terraform workflow (19% of the exam) - Section 3e

Apply changes to infrastructure with Terraform.

terraform apply executes the planned actions and updates state. Without a saved plan it generates a plan and prompts for approval; with a saved plan file it applies exactly those actions. Candidates should reason about -auto-approve and how apply updates state as resources are created.

terraform applyapply prompts for approvalauto-approveapply updates state

Practice question for this objective

Free sampleCore Terraform workflowmedium

A candidate is comparing 'terraform plan' and 'terraform apply' in Terraform 1.x. Which statement correctly distinguishes what each command does to real infrastructure and to state?

  • ABoth commands can modify real resources, but only apply writes the results back to the state file.
  • BPlan modifies infrastructure to match the configuration, while apply merely reports what plan already changed.
  • CPlan previews the proposed actions without changing infrastructure, while apply executes them and updates state. Correct
  • DPlan and apply are interchangeable, so either one both previews and enacts the changes in a single step.
'terraform plan' previews actions without altering infrastructure, while 'terraform apply' enacts them and updates state. Plan compares configuration against state and real resources to build a preview only, making no changes; apply performs the create, update, and destroy actions and then persists the new resource attributes into the state file.

Why A is wrong: This is tempting because both read state, but plan never modifies real resources; it only previews the actions apply would take.

Why B is wrong: This reverses the roles: plan is the preview and apply is the command that actually enacts changes, not the other way round.

Why C is correct: Plan is read-only against real resources and produces a preview, whereas apply carries out the actions and records the outcome in state.

Why D is wrong: They are distinct phases; plan cannot enact changes and treating them as interchangeable would defeat the review step apply relies on.

See more TF-Associate-004 practice questions, answers explained.

Exam traps in Core Terraform workflow

Answers that look right on this material and are not. Each one is a distractor from a different question in the TF-Associate-004 bank for this domain.

  • Terraform discards the saved plan, recomputes a fresh plan, and prompts for approval before applying.

    Why it is wrong: Tempting because a bare apply does recompute and prompt, but supplying a saved plan file changes that behaviour entirely.

  • Terraform ignores the saved plan and recomputes a fresh set of actions before prompting for approval.

    Why it is wrong: This is tempting because apply usually plans first, but passing a saved plan tells Terraform to use those exact actions rather than recompute them.

  • Terraform immediately applies the last plan saved to disk without recalculating what needs to change.

    Why it is wrong: This is tempting because apply can consume a saved plan, but that only happens when you pass the plan file as an argument, not by default.

More in this domain

Back to all Core Terraform workflow objectives, or the TF-Associate-004 cert hub.

Examworthy is not affiliated with or endorsed by HashiCorp. Original, blueprint-aligned practice material only.