Command: show
Theterraform show command is used to provide human-readable output from a state or plan file. This can be used to inspect a plan to ensure that the planned operations are expected, or to inspect the current state.
Usage
Options
-
-no-color- If specified, output won’t contain any color. -
-json- If specified, output the Terraform plan or state in a machine-readable JSON format.
JSON Output Format
When the-json flag is used, the output is in a JSON format that is designed to be stable across Terraform versions. The JSON output contains the same information that the human-readable output does, but in a structured format that is easier for machines to parse.
Examples
Show the current state:Output with No Path
When you runterraform show with no path argument, Terraform will display the state from the currently-selected workspace. If there is no state, the command will display an error.
Output for a Plan File
When you runterraform show with the path to a plan file (created with terraform plan -out=FILE), Terraform will display:
- The configuration snapshot used for the plan
- The resource changes that the plan proposes
- The output value changes that the plan proposes
terraform apply FILE.
Output for a State File
When you runterraform show with the path to a state file, Terraform will display the contents of that state file. This is useful when reviewing a state file that is not the current state of the selected workspace.