mirror of
https://github.com/hashicorp/terraform.git
synced 2026-02-18 18:29:44 -05:00
56 lines
2.3 KiB
Text
56 lines
2.3 KiB
Text
---
|
|
page_title: terraform show command reference
|
|
description: The `terraform show` command provides human-readable output from a state or plan file.
|
|
---
|
|
|
|
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
|
|
> [!IMPORTANT]
|
|
> **Documentation Update:** Product documentation previously located in `/website` has moved to the [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs) repository, where all product documentation is now centralized. Please make contributions directly to `web-unified-docs`, since changes to `/website` in this repository will not appear on developer.hashicorp.com.
|
|
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
|
|
|
|
|
|
# `terraform show` command
|
|
|
|
The `terraform show` command provides human-readable output
|
|
from a state or plan file. Use the command to inspect a plan to ensure
|
|
that the planned operations are expected, or to inspect the current state
|
|
as Terraform sees it.
|
|
|
|
|
|
-> **Note:** 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](/terraform/language/state/sensitive-data).
|
|
|
|
## JSON Output
|
|
|
|
Add the `-json` command-line flag to generate machine-readable output.
|
|
|
|
For Terraform state files, including when no path is provided,
|
|
`terraform show -json` shows a JSON representation of the state.
|
|
|
|
For Terraform plan files, `terraform show -json` shows a JSON representation
|
|
of the plan, configuration, and current state.
|
|
|
|
If you updated providers that contain new schema versions since the state
|
|
was written, upgrade the state before so that Terraform can display it with
|
|
`show -json`. If you are viewing a plan, it must be created without
|
|
`-refresh=false`. If you are viewing a state file, run `terraform refresh`
|
|
first.
|
|
|
|
The output format is covered in detail in [JSON Output Format](/terraform/internals/json-format).
|
|
|
|
## Usage
|
|
|
|
Usage: `terraform show [options] [file]`
|
|
|
|
You may use `show` with a path to either a Terraform state file or plan
|
|
file. If you don't specify a file path, Terraform will show the latest state
|
|
snapshot.
|
|
|
|
This command accepts the following options:
|
|
|
|
* `-no-color` - Disables output with coloring
|
|
|
|
* `-json` - Displays machine-readable output from a state or plan file
|
|
|
|
-> JSON output via the `-json` option requires **Terraform v0.12 or later**.
|