--- page_title: terraform plan command reference description: >- The `terraform plan` command creates an execution plan with a preview of the changes that Terraform will make to your infrastructure. # START AUTO GENERATED METADATA, DO NOT EDIT created_at: 2025-11-19T19:11:19Z last_modified: 2026-09-14T19:41:22.000Z # END AUTO GENERATED METADATA --- # `terraform plan` command The `terraform plan` command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure. ## Introduction By default, Terraform performs the following operations when it creates a plan: * Reads the current state of any already-existing remote objects to make sure that the Terraform state is up-to-date. * Compares the current configuration to the prior state and noting any differences. * Proposes a set of change actions that should, if applied, make the remote objects match the configuration. > **Hands-on:** Try the [Terraform: Get Started](/terraform/tutorials/aws-get-started?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorials. For more in-depth details on the `plan` command, check out the [Create a Terraform Plan tutorial](/terraform/tutorials/cli/plan?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS). The `plan` command alone does not actually carry out the proposed changes You can use this command to check whether the proposed changes match what you expected before you apply the changes or share your changes with your team for broader review. If Terraform detects that no changes are needed to resource instances or to root module output values, `terraform plan` will report that no actions need to be taken. If you are using Terraform directly in an interactive terminal and you expect to apply the changes Terraform proposes, you can alternatively run [`terraform apply`](/terraform/cli/commands/apply) directly. By default, the "apply" command automatically generates a new plan and prompts for you to approve it. You can use the optional `-out=FILE` option to save the generated plan to a file on disk, which you can later execute by passing the file to [`terraform apply`](/terraform/cli/commands/apply) as an extra argument. This two-step workflow is primarily intended for when [running Terraform in automation](/terraform/tutorials/automation/automate-terraform?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS). If you run `terraform plan` without the `-out=FILE` option then it will create a _speculative plan_, which is a description of the effect of the plan but without any intent to actually apply it. In teams that use a version control and code review workflow for making changes to real infrastructure, developers can use speculative plans to verify the effect of their changes before submitting them for code review. However, it's important to consider that other changes made to the target system in the meantime might cause the final effect of a configuration change to be different than what an earlier speculative plan indicated, so you should always re-check the final non-speculative plan before applying to make sure that it still matches your intent. ## Usage Usage: `terraform plan [options]` The `plan` subcommand looks in the current working directory for the root module configuration. Because the plan command is one of the main commands of Terraform, it has a variety of different options, described in the following sections. However, most of the time you should not need to set any of these options, because a Terraform configuration should typically be designed to work with no special additional options for routine work. The remaining sections on this page describe the various options: * **[Planning Modes](#planning-modes)**: There are some special alternative planning modes that you can use for some special situations where your goal is not just to change the remote system to match your configuration. * **[Planning Options](#planning-options)**: Alongside the special planning modes, there are also some options you can set in order to customize the planning process for unusual needs. * **[Resource Targeting](#resource-targeting)** is one particular special planning option that has some important caveats associated with it. * **[Other Options](#other-options)**: These change the behavior of the planning command itself, rather than customizing the content of the generated plan. ## Planning Modes The previous section describes Terraform's default planning behavior, which changes the remote system to match the changes you make to your configuration. Terraform has two alternative planning modes, each of which creates a plan with a different intended outcome. These options are available for both `terraform plan` and [`terraform apply`](/terraform/cli/commands/apply). * **Destroy mode:** creates a plan whose goal is to destroy all remote objects that currently exist, leaving an empty Terraform state. It is the same as running [`terraform destroy`](/terraform/cli/commands/destroy). Destroy mode can be useful for situations like transient development environments, where the managed objects cease to be useful once the development task is complete. Activate destroy mode using the `-destroy` command line option. * **Refresh-only mode:** creates a plan whose goal is only to update the Terraform state and any root module output values to match changes made to remote objects outside of Terraform. This can be useful if you've intentionally changed one or more remote objects outside of the usual workflow (e.g. while responding to an incident) and you now need to reconcile Terraform's records with those changes. Activate refresh-only mode using the `-refresh-only` command line option. In situations where we need to discuss the default planning mode that Terraform uses when none of the alternative modes are selected, we refer to it as "Normal mode". Because these alternative modes are for specialized situations only, some other Terraform documentation only discusses the normal planning mode. The planning modes are all mutually-exclusive, so activating any non-default planning mode disables the "normal" planning mode, and you can't use more than one alternative mode at the same time. -> **Note:** In Terraform v0.15 and earlier, the `-destroy` option is supported only by the `terraform plan` command, and not by the `terraform apply` command. To create and apply a plan in destroy mode in earlier versions you must run [`terraform destroy`](/terraform/cli/commands/destroy). -> **Note:** The `-refresh-only` option is available only in Terraform v0.15.4 and later. > **Hands-on:** Try the [Use Refresh-Only Mode to Sync Terraform State](/terraform/tutorials/state/refresh) tutorial. ## Planning Options In addition to alternate [planning modes](#planning-modes), there are several options that can modify planning behavior. These options are available for both `terraform plan` and [`terraform apply`](/terraform/cli/commands/apply). - `-invoke=action..