github.com/adamar/terraform@v0.2.2-0.20141016210445-2e703afdad0e/website/source/docs/commands/apply.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Command: apply"
     4  sidebar_current: "docs-commands-apply"
     5  ---
     6  
     7  # Command: apply
     8  
     9  The `terraform apply` command is used to apply the changes required
    10  to reach the desired state of the configuration, or the pre-determined
    11  set of actions generated by a `terraform plan` execution plan.
    12  
    13  ## Usage
    14  
    15  Usage: `terraform apply [options] [dir]`
    16  
    17  By default, `apply` scans the current directory for the configuration
    18  and applies the changes appropriately. However, a path to another configuration
    19  or an execution plan can be provided. Execution plans can be used to only
    20  execute a pre-determined set of actions.
    21  
    22  The `dir` argument can also be a [module source](/docs/modules/index.html).
    23  In this case, `apply` behaves as though `init` were called with that
    24  argument followed by an `apply` in the current directory. This is meant
    25  as a shortcut for getting started.
    26  
    27  The command-line flags are all optional. The list of available flags are:
    28  
    29  * `-backup=path` - Path to the backup file. Defaults to `-state-out` with
    30    the ".backup" extension. Disabled by setting to "-".
    31  
    32  * `-no-color` - Disables output with coloring.
    33  
    34  * `-refresh=true` - Update the state for each resource prior to planning
    35    and applying. This has no effect if a plan file is given directly to
    36    apply.
    37  
    38  * `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
    39  
    40  * `-state-out=path` - Path to write updated state file. By default, the
    41    `-state` path will be used.
    42  
    43  * `-var 'foo=bar'` - Set a variable in the Terraform configuration. This
    44    flag can be set multiple times.
    45  
    46  * `-var-file=foo` - Set variables in the Terraform configuration from
    47     a file. If "terraform.tfvars" is present, it will be automatically
    48     loaded if this flag is not specified.
    49