github.com/lamielle/terraform@v0.3.2-0.20141121070651-81f008ba53d5/website/source/docs/commands/plan.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Command: plan"
     4  sidebar_current: "docs-commands-plan"
     5  description: |-
     6    The `terraform plan` command is used to create an execution plan. Terraform performs a refresh, unless explicitly disabled, and then determines what actions are necessary to achieve the desired state specified in the configuration files. The plan can be saved using `-out`, and then provided to `terraform apply` to ensure only the pre-planned actions are executed.
     7  ---
     8  
     9  # Command: plan
    10  
    11  The `terraform plan` command is used to create an execution plan. Terraform
    12  performs a refresh, unless explicitly disabled, and then determines what
    13  actions are necessary to achieve the desired state specified in the
    14  configuration files. The plan can be saved using `-out`, and then provided
    15  to `terraform apply` to ensure only the pre-planned actions are executed.
    16  
    17  ## Usage
    18  
    19  Usage: `terraform plan [options] [dir]`
    20  
    21  By default, `plan` requires no flags and looks in the current directory
    22  for the configuration and state file to refresh.
    23  
    24  The command-line flags are all optional. The list of available flags are:
    25  
    26  * `-backup=path` - Path to the backup file. Defaults to `-state-out` with
    27    the ".backup" extension. Disabled by setting to "-".
    28  
    29  * `-destroy` - If set, generates a plan to destroy all the known resources.
    30  
    31  * `-no-color` - Disables output with coloring.
    32  
    33  * `-out=path` - The path to save the generated execution plan. This plan
    34    can then be used with `terraform apply` to be certain that only the
    35    changes shown in this plan are applied. Read the warning on saved
    36    plans below.
    37  
    38  * `-refresh=true` - Update the state prior to checking for differences.
    39  
    40  * `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
    41  
    42  * `-var 'foo=bar'` - Set a variable in the Terraform configuration. This
    43    flag can be set multiple times.
    44  
    45  * `-var-file=foo` - Set variables in the Terraform configuration from
    46     a file. If "terraform.tfvars" is present, it will be automatically
    47     loaded if this flag is not specified.
    48  
    49  ## Security Warning
    50  
    51  Saved plan files (with the `-out` flag) encode the configuration,
    52  state, diff, and _variables_. Variables are often used to store secrets.
    53  Therefore, the plan file can potentially store secrets.
    54  
    55  Terraform itself does not encrypt the plan file. It is highly
    56  recommended to encrypt the plan file if you intend to transfer it
    57  or keep it at rest for an extended period of time.
    58  
    59  Future versions of Terraform will make plan files more
    60  secure.