October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Terraform Plan: Preview Resource Changes Before Applying

Use terraform plan to preview proposed infrastructure changes, inspect replacements and deletions, and apply only a reviewed final or saved plan.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run terraform plan to preview the infrastructure changes Terraform proposes, then inspect the affected resources and values before applying anything. The plan command does not itself change remote infrastructure. For an automation or review handoff, save the plan with -out, inspect that saved file, and apply the same file rather than generating a different plan.

What Terraform plans—and what it does not

In normal mode, Terraform refreshes its view of remote objects, compares the configuration with prior state, and proposes actions intended to bring managed objects in line with the configuration. A plan is a proposal, not an execution: running terraform plan alone does not carry out the proposed changes. See HashiCorp’s terraform plan command reference.

As an Amazon Associate I earn from qualifying purchases.

A plan is based on the configuration and infrastructure Terraform observes at planning time. A speculative plan—one created without saving it using -out—is useful for review, but remote infrastructure may change before a later apply. HashiCorp advises checking the final non-speculative plan before applying it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create and review a plan

  1. In the Terraform working directory, initialize the working environment if needed: terraform init. Initialization prepares the directory for Terraform operations. The official Create a Terraform plan tutorial walks through this workflow.

  2. Preview the proposed changes: terraform plan. Terraform refreshes its view of remote objects in normal mode, then reports the actions it proposes.

  3. Review the output resource by resource. Check each resource address, action, planned value, and any effects on outputs. Pay particular attention to resources marked for replacement or deletion; summary totals alone do not show the impact on each object.

  4. For an interactive workflow, run terraform apply. It creates a fresh plan and asks for approval by default. Inspect that final plan before approving it. The terraform apply command reference explains the apply behavior.

    What’s actually slowing this PC down?

    Pick the symptom - the matching free tool is one click away.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read the action symbols

Symbol Meaning What to check
+ Create a resource Confirm the address and proposed values are expected.
- Destroy a resource Confirm that removal is intentional and identify what depends on the object.
~ Update a resource in place Review which values change and the operational effect of the update.
-/+ Replace a resource by destroying it and creating it again Check whether replacement is intended and whether the interruption or loss of existing data is acceptable.

These symbols describe proposed actions; inspect the full resource details rather than inferring impact from the symbol or plan totals. HashiCorp’s plan reference documents the symbols and sample output.

Choose the right planning workflow

Interactive local review

Use terraform plan to preview, then terraform apply to generate and review a fresh plan before approving it. If there is a delay or infrastructure may have changed since your preview, rely on the plan shown by the final apply rather than assuming the earlier preview is still current.

Saved plan for a handoff or automation

Save the proposal, inspect it, and apply that same saved plan:

terraform plan -out=tfplan
terraform show tfplan
terraform apply tfplan

A saved plan records the planned operations; applying it does not prompt for approval. This makes it suitable for a review-to-apply handoff, but the file is not a casual text export: HashiCorp says it contains the full configuration, planned values, plan options, and input variables. Store and transfer it accordingly. For automation that must not stop for missing input, HashiCorp documents -input=false as an option; automation should also ensure required inputs are provided. See the plan reference, the apply reference, and Running Terraform in automation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a mode that matches the intended outcome

Mode or option Purpose Review implication
Normal mode: terraform plan Refresh remote objects and propose changes that bring managed infrastructure toward the configuration. Review proposed creates, updates, replacements, deletions, and output effects.
Refresh-only: terraform plan -refresh-only Review how Terraform state and root module outputs should change after out-of-band infrastructure changes. It reconciles recorded state; it does not propose undoing the external changes on remote objects. Inspect unexpected differences before applying.
Destroy mode: terraform plan -destroy Preview destruction of all managed remote objects. Use only when removal is intended, and inspect the proposed deletions before applying.

When external changes need to be recorded

If someone changed infrastructure outside Terraform and you want to reconcile Terraform’s state with what exists, use terraform plan -refresh-only. Review the state changes before applying them; this mode does not change remote objects to match the configuration. The refresh-only tutorial describes a consequential failure case: if provider settings point to the wrong region, Terraform may fail to find a real object and infer that it was deleted. Before accepting unexpected drift, check credentials, provider configuration, and region.

The older terraform refresh command is deprecated because it automatically applies a state refresh. HashiCorp recommends reviewing with terraform plan -refresh-only and, if appropriate, applying with terraform apply -refresh-only. See the terraform refresh command reference.

When destruction is intended

terraform plan -destroy previews a plan intended to destroy all managed remote objects. Review the deletion list carefully before proceeding. terraform destroy is a convenience alias for applying in destroy mode, not a safer preview command. See the terraform destroy command reference.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Options that change planning behavior

Option behavior is documented in the terraform plan command reference.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.