From 75d38b50b12b3063c4cd022d60ee86e81d504b7b Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Fri, 22 Jan 2021 10:30:01 -0500 Subject: [PATCH] docs: Note: state pull upgrades to current version --- command/state_pull.go | 6 +++++- website/docs/cli/commands/state/pull.html.md | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/command/state_pull.go b/command/state_pull.go index 1c797013e..f2f368348 100644 --- a/command/state_pull.go +++ b/command/state_pull.go @@ -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. diff --git a/website/docs/cli/commands/state/pull.html.md b/website/docs/cli/commands/state/pull.html.md index af2122668..c61177b0a 100644 --- a/website/docs/cli/commands/state/pull.html.md +++ b/website/docs/cli/commands/state/pull.html.md @@ -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.