Inspect state with the CLI
Unlock the complete study guide + 1,040 practice questions across 16 full exams.
Bundled into the existing HashiCorp Certified: Terraform Associate premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- The read-only inspection toolbox
- Listing and showing individual state entries
- Rendered state, plans, and outputs
- The dependency graph and the toolchain
- Exam-pattern recognition
State-inspection commands at a glance (all read-only)
| Command | What it reads | Output form | Typical use |
|---|---|---|---|
| terraform state list | Resource addresses in state | Plain text, one address per line | Find a resource's address |
| terraform state show ADDRESS | One resource's attributes | Human-readable text | Inspect one resource |
| terraform state pull | The full state from the backend | Raw JSON on stdout | Pipe state to jq |
| terraform show [PLANFILE] | Latest state or a saved plan | Human text, or JSON with -json | Review state or a plan |
| terraform output [NAME] | Root module output values | Text, -json for all, -raw for one string | Read outputs, feed scripts |
| terraform graph | Configuration dependency graph | DOT text, render with Graphviz | Visualize dependencies |
| terraform providers | Provider requirement tree | Text tree | Trace provider requirements |
| terraform version | Core, platform, and provider versions | Text | Check versions and updates |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
References
- Command: terraform state rm
- Command: terraform state mv
- Command: terraform state list
- Command: terraform state show
- Command: terraform state pull
- Command: terraform show
- Command: terraform output
- Command: terraform graph
- Command: terraform providers
- Command: terraform version
- Command: terraform state push