github.com/chalford/terraform@v0.3.7-0.20150113080010-a78c69a8c81f/website/source/docs/commands/refresh.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "Command: refresh" 4 sidebar_current: "docs-commands-refresh" 5 description: |- 6 The `terraform refresh` command is used to reconcile the state Terraform knows about (via its state file) with the real-world infrastructure. This can be used to detect any drift from the last-known state, and to update the state file. 7 --- 8 9 # Command: refresh 10 11 The `terraform refresh` command is used to reconcile the state Terraform 12 knows about (via its state file) with the real-world infrastructure. 13 This can be used to detect any drift from the last-known state, and to 14 update the state file. 15 16 This does not modify infrastructure, but does modify the state file. 17 If the state is changed, this may cause changes to occur during the next 18 plan or apply. 19 20 ## Usage 21 22 Usage: `terraform refresh [options] [dir]` 23 24 By default, `refresh` requires no flags and looks in the current directory 25 for the configuration and state file to refresh. 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 * `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate". 35 36 * `-state-out=path` - Path to write updated state file. By default, the 37 `-state` path will be used. 38 39 * `-var 'foo=bar'` - Set a variable in the Terraform configuration. This 40 flag can be set multiple times. 41 42 * `-var-file=foo` - Set variables in the Terraform configuration from 43 a file. If "terraform.tfvars" is present, it will be automatically 44 loaded if this flag is not specified. 45