Merge pull request #14022 from hashicorp/skierkowski/tfe-state-docs-0-9-update

Updating TFE state documentation for 0.9.X
This commit is contained in:
Maciej Skierkowski 2017-04-28 11:46:00 -07:00 committed by GitHub
commit 5c4d85d7dc
4 changed files with 23 additions and 36 deletions

View File

@ -8,7 +8,7 @@ description: |-
# Collaborating on Terraform Remote State
Terraform Enterprise is one of a few options to store [remote state](/docs/enterprise/state).
Terraform Enterprise is one of a few options to store [remote state](/docs/state/remote.html).
Remote state gives you the ability to version and collaborate on Terraform
changes. It stores information about the changes Terraform makes based on
@ -18,6 +18,5 @@ In order to collaborate safely on remote state, we recommend
[creating an organization](/docs/enterprise/organizations/create.html) to
manage teams of users.
Then, following a [remote state push](/docs/enterprise/state) you can view state
versions in the changes tab of the environment created under the same name as
the remote state.
Then, following a [Terraform Enterprise Run](/docs/enterprise/runs) or [`apply`](/docs/commands/apply.html)
you can view state versions in the `States` list of the environment.

View File

@ -8,17 +8,17 @@ description: |-
# State
Terraform stores the state of your managed infrastructure from the last time
Terraform was run. By default this state is stored in a local file named
`terraform.tfstate`, but it can also be stored remotely, which works better in a
team environment.
Terraform Enterprise is a remote state provider, allowing you to store, version
and collaborate on states.
Terraform Enterprise stores the state of your managed infrastructure from the
last time Terraform was run. The state is stored remotely, which works better in a
team environment, allowing you to store, version and collaborate on state.
Remote state gives you more than just easier version control and safer storage.
It also allows you to delegate the outputs to other teams. This allows your
infrastructure to be more easily broken down into components that multiple teams
can access.
Read [more about remote state](https://www.terraform.io/docs/state/remote.html).
Remote state is automatically updated when you run [`apply`](/docs/commands/apply.html)
locally. It is also updated when an `apply` is executed in a [Terraform Enterprise
Run](/docs/enterprise/runs/index.html).
Read [more about remote state](/docs/state/remote.html).

4
website/source/docs/enterprise/state/pushing.html.md Executable file → Normal file
View File

@ -17,7 +17,9 @@ configuration.
To use Terraform Enterprise to store remote state, you'll first need to have the
`ATLAS_TOKEN` environment variable set and run the following command.
**NOTE:** `terraform remote config` command has been deprecated in 0.9.X. Remote configuration is now managed as a [backend configuration](/docs/backends/config.html).
```shell
$ terraform remote config \
-backend-config="name=$USERNAME/product"
```
```

View File

@ -35,36 +35,22 @@ operation.
### Using Terraform Locally
Another way to resolve remote state conflicts is to merge and conflicted copies
locally by inspecting the raw state available in the path
`.terraform/terraform.tfstate`.
Another way to resolve remote state conflicts is by manual intervention of the
state file.
When making state changes, it's important to make backup copies in order to
avoid losing any data.
Use the [`state pull`](/docs/commands/state/pull.html) subcommand to pull the
remote state into a local state file.
Any state that is pushed with a serial that is lower than the known serial when
the MD5 of the state does not match will be rejected.
The serial is embedded in the state file:
```json
{
"version": 1,
"serial": 555,
"remote": {
"type": "atlas",
"config": {
"name": "my-username/production"
}
}
}
```shell
$ terraform state pull > example.tfstate
```
Once a conflict has been resolved locally by editing the state file, the serial
can be incremented past the current version and pushed:
can be incremented past the current version and pushed with the
[`state push`](/docs/commands/state/push.html) subcommand:
```shell
$ terraform remote push
$ terraform state push example.tfstate
```
This will upload the manually resolved state and set it as the head version.