github.com/xsb/terraform@v0.6.13-0.20160314145438-fe415c2f09d7/website/source/docs/state/remote/index.html.md (about)

     1  ---
     2  layout: "remotestate"
     3  page_title: "Remote State"
     4  sidebar_current: "docs-state-remote_index"
     5  description: |-
     6    Terraform can store the state remotely, making it easier to version and work with in a team.
     7  ---
     8  
     9  # Remote State
    10  
    11  By default, Terraform stores state locally in a file named "terraform.tfstate".
    12  Because this file must exist, it makes working with Terraform in a team
    13  complicated since it is a frequent source of merge conflicts. Remote state
    14  helps alleviate these issues.
    15  
    16  With remote state, Terraform stores the state in a remote store. Terraform
    17  supports storing state in [Atlas](https://atlas.hashicorp.com),
    18  [Consul](https://www.consul.io), S3, and more.
    19  
    20  You can begin using remote state from the beginning with flags to the
    21  [init](/docs/commands/init.html) command, or you can migrate an existing
    22  local state to remote state using the
    23  [remote config](/docs/commands/remote-config.html) command. You can also
    24  use the remote config to disable remote state and move back to local
    25  state.
    26  
    27  ## Delegation and Teamwork
    28  
    29  Remote state gives you more than just easier version control and
    30  safer storage. It also allows you to delegate the
    31  [outputs](/docs/configuration/outputs.html) to other teams. This allows
    32  your infrastructure to be more easily broken down into components that
    33  multiple teams can access.
    34  
    35  Put another way, remote state also allows teams to share infrastructure
    36  resources in a read-only way.
    37  
    38  For example, a core infrastructure team can handle building the core
    39  machines, networking, etc. and can expose some information to other
    40  teams to run their own infrastructure. As a more specific example with AWS:
    41  you can expose things such as VPC IDs, subnets, NAT instance IDs, etc. through
    42  remote state and have other Terraform states consume that.
    43  
    44  For example usage see the [terraform_remote_state](/docs/providers/terraform/r/remote_state.html) resource.
    45  
    46  ## Locking and Teamwork
    47  
    48  Remote state currently **does not** lock regions of your infrastructure
    49  to allow parallel modification using Terraform. Therefore, you must still
    50  collaborate with teammates to safely run Terraform.
    51  
    52  [Atlas by HashiCorp](https://atlas.hashicorp.com) is a commercial offering
    53  that does safely allow parallel Terraform runs and handles infrastructure
    54  locking for you.
    55  
    56  In the future, we'd like to extend the remote state system to allow some
    57  minimal locking functionality, but it is a difficult problem without a
    58  central system that we currently aren't focused on solving.