TF-Associate-004 - Core Terraform workflow - Section 3d

Generate and review an execution plan for Terraform.

terraform plan produces a preview of create, update, in-place versus replace, and destroy actions by diffing configuration against state and refreshing real resources. A plan makes no changes. Candidates should read plan symbols and know a saved plan file can be passed to apply.

terraform planplan does not change infrastructurecreate update replace destroysaved plan file

Practice question for this objective

Free sampleCore Terraform workflowmedium

A practitioner runs 'terraform plan' against a configuration that would add two resources and delete one. Before the command finishes, they cancel a meeting because they worry the plan has already begun deleting the resource. A colleague reassures them. Which statement correctly describes what running 'terraform plan' on its own has done to the real infrastructure?

$ terraform plan
Plan: 2 to add, 0 to change, 1 to destroy.
  • AIt has made no changes; plan only previews the actions it would take and leaves the real infrastructure untouched. Correct
  • BIt has already deleted the one resource marked for destroy, because destroys are executed during the plan phase for safety.
  • CIt has created the two new resources but deferred the destroy until an apply is run.
  • DIt has applied every change immediately because no '-out' file was supplied to hold the proposal.
Understand that 'terraform plan' only previews proposed actions and makes no changes to real infrastructure. The plan command reads configuration, refreshes state against the provider, and computes a diff of intended create, update, and destroy actions. It is strictly read-and-report: no resource is altered until apply executes the proposed changes.

Why A is correct: Correct: 'terraform plan' compares the configuration and refreshed state to build a proposed set of actions, but it never creates, updates, or destroys real resources.

Why B is wrong: Tempting because the summary lists a destroy, but plan only reports intended actions; nothing is destroyed until 'terraform apply' runs.

Why C is wrong: Plausible if you assume additions are low risk, but plan creates nothing; all actions, additions included, wait for apply.

Why D is wrong: The absence of '-out' only means the proposal is not saved to disk; it does not cause plan to apply anything, which plan never does.

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.