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