mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-22 14:00:57 -05:00
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com> Signed-off-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> Signed-off-by: Roman Grinovski <roman.grinovski@gmail.com> Co-authored-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> Co-authored-by: Roman Grinovski <roman.grinovski@gmail.com>
32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
---
|
|
description: >-
|
|
The `tofu state pull` command is used to manually download and output the
|
|
state from remote state.
|
|
---
|
|
|
|
# Command: state pull
|
|
|
|
The `tofu state pull` command is used to manually download and output
|
|
the state from [remote state](../../../language/state/remote.mdx). This command also
|
|
works with local state.
|
|
|
|
## Usage
|
|
|
|
Usage: `tofu state pull`
|
|
|
|
This command downloads the state from its current location, upgrades the
|
|
local copy to the latest state file version that is compatible with
|
|
locally-installed OpenTofu, and outputs 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.
|
|
|
|
You cannot use this command to inspect the OpenTofu version of
|
|
the remote state, as it will always be converted to the current OpenTofu
|
|
version before output.
|
|
|
|
:::note
|
|
OpenTofu state files must be in UTF-8 format without a byte order mark (BOM). For PowerShell on Windows, use `Set-Content` to automatically encode files in UTF-8 format. For example, run `tofu state pull | sc terraform.tfstate`.
|
|
:::
|