github.com/atsaki/terraform@v0.4.3-0.20150919165407-25bba5967654/website/source/docs/state/index.html.md (about)

     1  ---
     2  layout: "docs"
     3  page_title: "State"
     4  sidebar_current: "docs-state"
     5  description: |-
     6    Terraform stores state which caches the known state of the world the last time Terraform ran.
     7  ---
     8  
     9  # State
    10  
    11  Terraform stores the state of your managed infrastructure from the last
    12  time Terraform was run. By default this state is stored in a local file
    13  named "terraform.tfstate", but it can also be stored remotely, which works
    14  better in a team environment.
    15  
    16  Terraform uses this local state to create plans and make changes to your
    17  infrastructure. Prior to any operation, Terraform does a
    18  [refresh](/docs/commands/refresh.html) to update the state with the
    19  real infrastructure.
    20  
    21  -> **Note:** Terraform currently requires the state to exist after Terraform
    22  has been run. Technically,
    23  at some point in the future, Terraform should be able to populate the local
    24  state file with the real infrastructure if the file didn't exist. But currently,
    25  Terraform state is a mixture of both a cache and required configuration and
    26  isn't optional.
    27  
    28  ## Format
    29  
    30  The state is in JSON format and Terraform will promise backwards compatibility
    31  with the state file. The JSON format makes it easy to write tools around the
    32  state if you want or to modify it by hand in the case of a Terraform bug.
    33  The "version" field on the state contents allows us to transparently move
    34  the format forward if we make modifications.
    35