github.com/kcburge/terraform@v0.11.12-beta1/website/docs/commands/state/index.html.md (about)

     1  ---
     2  layout: "commands-state"
     3  page_title: "Command: state"
     4  sidebar_current: "docs-state-index"
     5  description: |-
     6    The `terraform state` command is used for advanced state management.
     7  ---
     8  
     9  # State Command
    10  
    11  The `terraform state` command is used for advanced state management.
    12  As your Terraform usage becomes more advanced, there are some cases where
    13  you may need to modify the [Terraform state](/docs/state/index.html).
    14  Rather than modify the state directly, the `terraform state` commands can
    15  be used in many cases instead.
    16  
    17  This command is a nested subcommand, meaning that it has further subcommands.
    18  These subcommands are listed to the left.
    19  
    20  ## Usage
    21  
    22  Usage: `terraform state <subcommand> [options] [args]`
    23  
    24  Please click a subcommand to the left for more information.
    25  
    26  ## Remote State
    27  
    28  The Terraform state subcommands all work with remote state just as if it
    29  was local state. Reads and writes may take longer than normal as each read
    30  and each write do a full network roundtrip. Otherwise, backups are still
    31  written to disk and the CLI usage is the same as if it were local state.
    32  
    33  ## Backups
    34  
    35  All `terraform state` subcommands that modify the state write backup
    36  files. The path of these backup file can be controlled with `-backup`.
    37  
    38  Subcommands that are read-only (such as [list](/docs/commands/state/list.html))
    39  do not write any backup files since they aren't modifying the state.
    40  
    41  Note that backups for state modification _can not be disabled_. Due to
    42  the sensitivity of the state file, Terraform forces every state modification
    43  command to write a backup file. You'll have to remove these files manually
    44  if you don't want to keep them around.
    45  
    46  ## Command-Line Friendly
    47  
    48  The output and command-line structure of the state subcommands is
    49  designed to be easy to use with Unix command-line tools such as grep, awk,
    50  etc. Consequently, the output is also friendly to the equivalent PowerShell
    51  commands within Windows.
    52  
    53  For advanced filtering and modification, we recommend piping Terraform
    54  state subcommands together with other command line tools.