Review and apply a local plan
A plan is a proposal, not a deployment
A normal plan describes the changes Terraform proposes after evaluating configuration and relevant state. Apply executes changes. In real projects planning can read provider APIs and state, so it is not an unrestricted offline dry run. Here we use only the reviewed built-in resource in the dedicated local lab. Continue only after initialization and validation succeed. The following examples are illustrative; no Terraform process was run to capture them.
Example: read a create plan
In the isolated fixture, request a saved plan and inspect it. Do not reuse an old plan or run the following against a shared directory.
terraform plan -out=lesson.tfplanterraform show lesson.tfplanExpected first-run summary: one resource to add, zero to change, zero to destroy. The only intended address is terraform_data.greeting. Its input is hello-bytemind; its generated identity and computed output may be unresolved until apply. Outputs are not additional managed resources. If a plan contains an unexpected address, replacement, deletion, error or remote operation, stop. The saved plan is a potentially sensitive artifact even when terminal output hides values; never commit or distribute it.
Example: apply only after approval
If the saved plan has been explicitly reviewed and approved for this disposable local fixture, the learner may apply it manually. Passing a saved plan to apply counts as approval; there is no second confirmation prompt. Without a saved plan, ordinary interactive apply creates a fresh plan and requests confirmation. Do not use automatic approval to skip review.
terraform apply lesson.tfplanterraform output -raw greetingterraform showThe expected raw greeting is hello-bytemind. The show command inspects the current recorded state when no file is supplied. State is Terraform’s record of managed objects, not a complete independent health check. An apply can fail partway through, so inspect the resulting state and diagnostics before deciding what to do next. Named output, raw output and JSON display can expose sensitive values; use only synthetic data.
Example: repeat the plan and interpret changes
With the same configuration and unchanged state, an ordinary terraform plan is expected to report no resource changes after a successful apply. If you change the greeting input to hello-again, a new plan should propose an update to the existing resource and its output rather than a new unrelated address. These are expected behaviors, not tested transcripts. Review the new plan before applying anything. An empty plan means no changes are proposed in that planning context, not that a real service is healthy.
Clean up the lab-owned resource
With the original local fixture still isolated and no other managed objects present, create a separate cleanup plan.
terraform plan -destroy -out=cleanup.tfplanterraform show cleanup.tfplanExpect only the greeting resource to be removed if it was successfully created. Stop if anything unexpected appears. Only after reviewing that plan may you run terraform apply cleanup.tfplan manually. Inspect the resulting state and confirm the resource is absent before removing the disposable directory. The terraform destroy command is another way to request destructive apply mode, but this lesson uses a separately reviewed saved plan. Never copy these cleanup commands into a production directory. Removing local state files alone is not a reliable infrastructure cleanup method.
Practice and next step
Read the synthetic create, no-change, update and cleanup summaries in the fixture folder. Decide which actions require approval and what evidence you would inspect afterward. Explain why a valid configuration or empty plan is not a health test. Next, study primitive values and null. Related reference: Review and apply a local plan.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Review and apply a local plan — knowledge check
Check the concepts and decisions introduced in this lesson.
A first local plan lists one add and no changes or removals. What is still needed?
What happens when you pass a saved plan to terraform apply?
Which command reads the named greeting output as plain text?
An unchanged plan proposes no resource changes. What follows?
A cleanup plan unexpectedly lists another resource. What should you do?