terraform show Command Reference
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, the basis for OPA/Conftest checks and PR plan summaries.
Common flags and usage
- [FILE]: a saved plan or state file to render
- -json: emit a machine-readable representation
- -no-color: disable color
Example
terraform plan -input=false -out=tfplan
terraform show -json tfplan | jq '.resource_changes[].change.actions'In CI
Pass the exact plan file from terraform plan -out=tfplan in the same job, and keep the CLI version consistent between plan and show, since the plan binary format is version-specific. Use -json output to drive policy gates and PR comments.
Key takeaways
- show renders the current state or a saved plan file.
- -json output powers policy checks (OPA/Conftest) and PR plan summaries.
- Use the same CLI version for plan and show; the format is version-specific.