From f7ab90207cec26388c2a62069b0dfc1e91a9c28b Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Tue, 29 Jan 2019 14:29:02 -0800 Subject: [PATCH] website/docs: add -json flag to terraform show docsn --- command/show.go | 4 ++-- website/docs/commands/show.html.markdown | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/command/show.go b/command/show.go index d14cae48d..b36658c32 100644 --- a/command/show.go +++ b/command/show.go @@ -186,8 +186,8 @@ Usage: terraform show [options] [path] Options: -no-color If specified, output won't contain any color. - -json If specified, output the Terraform plan in a machine- - readable form. Only available for plan files. + -json If specified, output the Terraform plan or state in + a machine-readable form. ` return strings.TrimSpace(helpText) diff --git a/website/docs/commands/show.html.markdown b/website/docs/commands/show.html.markdown index 64138a572..de89f5f0a 100644 --- a/website/docs/commands/show.html.markdown +++ b/website/docs/commands/show.html.markdown @@ -22,6 +22,14 @@ When using the `-json` command-line flag, any sensitive values in terraform state will be displayed in plain text. For more information, see [_Sensitive Data in State_](/docs/state/sensitive-data.html). +## json output + +When `terraform show -json` is run with a path to a Terraform state file or no +path, a json representation of the current state will be shown. + +When `terraform show -json` is run with a path to a Terraform plan file, a json +representation of the plan, configuration, and current state will be shown. + ## Usage Usage: `terraform show [options] [path]` @@ -33,4 +41,4 @@ The command-line flags are all optional. The list of available flags are: * `-no-color` - Disables output with coloring -* `-json` - Displays machine-readable output from a plan file +* `-json` - Displays machine-readable output from a state or plan file