mirror of https://github.com/hashicorp/terraform
parent
22dd47c8af
commit
7394a066ec
@ -0,0 +1,24 @@
|
||||
---
|
||||
layout: "commands-state"
|
||||
page_title: "Command: state pull"
|
||||
sidebar_current: "docs-state-sub-pull"
|
||||
description: |-
|
||||
The `terraform state pull` command is used to manually download and output the state from remote state.
|
||||
---
|
||||
|
||||
# Command: state pull
|
||||
|
||||
The `terraform state pull` command is used to manually download and output
|
||||
the state from [remote state](/docs/state/remote.html). This command also
|
||||
works with local state.
|
||||
|
||||
## Usage
|
||||
|
||||
Usage: `terraform state pull`
|
||||
|
||||
This command will download the state from its current location and
|
||||
output the raw format to stdout.
|
||||
|
||||
This is useful for reading values out of state (potentially pairing this
|
||||
command with something like [jq](https://stedolan.github.io/jq/)). It is
|
||||
also useful if you need to make manual modifications to state.
|
||||
@ -0,0 +1,40 @@
|
||||
---
|
||||
layout: "commands-state"
|
||||
page_title: "Command: state push"
|
||||
sidebar_current: "docs-state-sub-push"
|
||||
description: |-
|
||||
The `terraform state rm` command removes items from the Terraform state.
|
||||
---
|
||||
|
||||
# Command: state push
|
||||
|
||||
The `terraform state push` command is used to manually upload a local
|
||||
state file to [remote state](/docs/state/remote.html). This command also
|
||||
works with local state.
|
||||
|
||||
This command should rarely be used. It is meant only as a utility in case
|
||||
manual intervention is necessary with the remote state.
|
||||
|
||||
## Usage
|
||||
|
||||
Usage: `terraform state push [options] PATH`
|
||||
|
||||
This command will push the state specified by PATH to the currently
|
||||
configured [backend](/docs/backends).
|
||||
|
||||
Terraform will perform a number of safety checks to prevent you from
|
||||
making changes that appear to be unsafe:
|
||||
|
||||
* **Differing lineage**: If the "lineage" value in the state differs,
|
||||
Terraform will not allow you to push the state. A differing lineage
|
||||
suggests that the states are completely different and you may lose
|
||||
data.
|
||||
|
||||
* **Higher remote serial**: If the "serial" value in the destination state
|
||||
is higher than the state being pushed, Terraform will prevent the push.
|
||||
A higher serial suggests that data is in the destination state that isn't
|
||||
accounted for in the local state being pushed.
|
||||
|
||||
Both of these safety checks can be disabled with the `-force` flag.
|
||||
**This is not recommended.** If you disable the safety checks and are
|
||||
pushing state, the destination state will be overwritten.
|
||||
Loading…
Reference in new issue