Merge pull request #27572 from hashicorp/alisdair/document-state-pull-upgrade

docs: Note that state pull upgrades the state file to current version
This commit is contained in:
Alisdair McDiarmid 2021-01-25 10:55:35 -05:00 committed by GitHub
commit f6951a5d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -70,9 +70,13 @@ func (c *StatePullCommand) Help() string {
helpText := `
Usage: terraform state pull [options]
Pull the state from its location and output it to stdout.
Pull the state from its location, upgrade the local copy, and output it
to stdout.
This command "pulls" the current state and outputs it to stdout.
As part of this process, Terraform will upgrade the state format of the
local copy to the current version.
The primary use of this is for state stored remotely. This command
will still work with local state but is less useful for this.

View File

@ -16,9 +16,14 @@ works with local state.
Usage: `terraform state pull`
This command will download the state from its current location and
output the raw format to stdout.
This command will download the state from its current location, upgrade the
local copy to the latest state file version, 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.
~> Note: This command cannot be used to inspect the Terraform version of
the remote state, as it will always be converted to the current Terraform
version before output.