github.com/bengesoff/terraform@v0.3.1-0.20141018223233-b25a53629922/website/source/docs/commands/refresh.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Command: refresh"
     4  sidebar_current: "docs-commands-refresh"
     5  ---
     6  
     7  # Command: refresh
     8  
     9  The `terraform refresh` command is used to reconcile the state Terraform
    10  knows about (via its state file) with the real-world infrastructure.
    11  This can be used to detect any drift from the last-known state, and to
    12  update the state file.
    13  
    14  This does not modify infrastructure, but does modify the state file.
    15  If the state is changed, this may cause changes to occur during the next
    16  plan or apply.
    17  
    18  ## Usage
    19  
    20  Usage: `terraform refresh [options] [dir]`
    21  
    22  By default, `refresh` requires no flags and looks in the current directory
    23  for the configuration and state file to refresh.
    24  
    25  The command-line flags are all optional. The list of available flags are:
    26  
    27  * `-backup=path` - Path to the backup file. Defaults to `-state-out` with
    28    the ".backup" extension. Disabled by setting to "-".
    29  
    30  * `-no-color` - Disables output with coloring
    31  
    32  * `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate".
    33  
    34  * `-state-out=path` - Path to write updated state file. By default, the
    35    `-state` path will be used.
    36  
    37  * `-var 'foo=bar'` - Set a variable in the Terraform configuration. This
    38    flag can be set multiple times.
    39  
    40  * `-var-file=foo` - Set variables in the Terraform configuration from
    41     a file. If "terraform.tfvars" is present, it will be automatically
    42     loaded if this flag is not specified.
    43