From c7afb7db940ec9143e2e24b0d2ae9994a580f379 Mon Sep 17 00:00:00 2001 From: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com> Date: Fri, 18 Mar 2022 17:15:24 -0400 Subject: [PATCH 1/2] Add note about powershell formatting --- website/docs/cli/commands/state/pull.mdx | 8 +++++--- website/docs/cli/commands/state/push.mdx | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/website/docs/cli/commands/state/pull.mdx b/website/docs/cli/commands/state/pull.mdx index 5fc5a7ba3..b2765e567 100644 --- a/website/docs/cli/commands/state/pull.mdx +++ b/website/docs/cli/commands/state/pull.mdx @@ -15,14 +15,16 @@ works with local state. Usage: `terraform state pull` -This command will download the state from its current location, upgrade the +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 Terraform, and output the raw format to stdout. +locally-installed Terraform, 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. -~> Note: This command cannot be used to inspect the Terraform version of +You cannot use this command to inspect the Terraform version of the remote state, as it will always be converted to the current Terraform version before output. + +-> **Note:** Terraform 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 `terraform state pull | sc terraform.tfstate` diff --git a/website/docs/cli/commands/state/push.mdx b/website/docs/cli/commands/state/push.mdx index f4417b9b0..8ce576c17 100644 --- a/website/docs/cli/commands/state/push.mdx +++ b/website/docs/cli/commands/state/push.mdx @@ -16,13 +16,15 @@ manual intervention is necessary with the remote state. Usage: `terraform state push [options] PATH` -This command will push the state specified by PATH to the currently +This command pushes the state specified by PATH to the currently configured [backend](/language/settings/backends). If PATH is "-" then the state data to push is read from stdin. This data is loaded completely into memory and verified prior to being written to the destination state. +-> **Note:** Terraform 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 `terraform state push | sc terraform.tfstate`. + Terraform will perform a number of safety checks to prevent you from making changes that appear to be unsafe: From 0ba0fe667c294f8b073155e90cf2a7b8705fb0f1 Mon Sep 17 00:00:00 2001 From: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com> Date: Fri, 18 Mar 2022 17:18:25 -0400 Subject: [PATCH 2/2] Add period --- website/docs/cli/commands/state/pull.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/cli/commands/state/pull.mdx b/website/docs/cli/commands/state/pull.mdx index b2765e567..15c372e81 100644 --- a/website/docs/cli/commands/state/pull.mdx +++ b/website/docs/cli/commands/state/pull.mdx @@ -27,4 +27,4 @@ You cannot use this command to inspect the Terraform version of the remote state, as it will always be converted to the current Terraform version before output. --> **Note:** Terraform 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 `terraform state pull | sc terraform.tfstate` +-> **Note:** Terraform 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 `terraform state pull | sc terraform.tfstate`.