TF-Associate-004 - Core Terraform workflow - 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.

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.