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