Skip to content
Latchkey

terraform show: Usage, JSON output & CI Errors

Render a saved plan or state - human-readable, or as JSON for tooling.

terraform show prints a saved plan file or the current state in readable form, and with -json produces a stable machine format used by policy and diff tooling.

What it does

terraform show with no arguments prints the latest state. Given a saved plan file it prints that plan. The -json flag emits a documented JSON representation of the plan or state - the basis for OPA/Conftest policy checks and PR plan summaries in CI.

Common usage

Terminal
# Show current state
terraform show

# Render a saved plan (human-readable)
terraform plan -out=tfplan
terraform show tfplan

# JSON plan for policy checks / PR comments
terraform show -json tfplan | jq '.resource_changes[].change.actions'

Common error in CI: cannot parse plan / wrong file

show fails with "Error: Failed to read the given file as a state or plan file" when you point it at the wrong artifact, or the JSON is empty because the plan was created with a different Terraform version than the one running show. Fix: pass the exact plan file produced by terraform plan -out=tfplan in the same job, and keep the CLI version consistent between plan and show (the plan binary format is version-specific). Use -json only with a real plan/state file, never with config.

Key options

OptionPurpose
[FILE]A saved plan or state file to render
-jsonEmit a machine-readable representation
-no-colorDisable color

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →