kb/advanced ── Advanced ── advanced

Terraform Visualization: Rover, tf-summarize, terraform-docs

Three tools for three distinct jobs. **Rover** starts a local web UI on :9000 and renders state and plan as an interactive graph: zoom in, filter by type, click a node to see resource details. **tf-summarize** condenses a plan into a human-readable table showing counts of resources to add, change, and destroy. **terraform-docs** auto-generates a README from a module's variables and outputs. Each tool has a specific use case; they do not overlap.

view as markdownaka: rover, tf-summarize, terraform-docs, terraform-visualization

Rover: interactive UI

Rover (im2nguyen) is a Go application that starts a web UI on :9000 and renders state and plan as an interactive graph. You can zoom, filter by resource type, and click any node to see its details.

bash
rover -tfPath /home/student/myproject -planPath plan.tfplan
# browser: http://localhost:9000

Rover is useful when:

  • The plan is large and the text output does not fit on screen.
  • You want to see cross-module dependencies.
  • You are presenting the architecture to management or a new engineer.

The alternative is terraform graph | dot -Tpng > graph.png. Rover is dynamic and easier to navigate; the built-in terraform graph command is static but requires no external binary.

tf-summarize: plan diff in one table

bash
terraform plan -out=plan.tfplan
tf-summarize plan.tfplan

Output:

┌────────────────────────────────────────┬──────────┐
│ CHANGE                                 │ COUNT    │
├────────────────────────────────────────┼──────────┤
│ add                                    │ 12       │
│ change                                 │ 3        │
│ destroy                                │ 1        │
│ replace                                │ 2        │
├────────────────────────────────────────┼──────────┤
│ aws_s3_bucket                          │ 3 add    │
│ aws_iam_role                           │ 2 add    │
│ aws_lambda_function                    │ 1 change │
│ ...                                    │          │
└────────────────────────────────────────┴──────────┘

Useful for:

  • A PR comment with a short summary. Instead of a 5000-line plan output, you post one table.
  • CI logs: the full scope of a plan is visible on one screen.
bash
tf-summarize -md plan.tfplan > summary.md
# Markdown format for a PR comment

terraform-docs: auto-generated README

Designed for modules. It parses variables.tf and outputs.tf and generates a Markdown file with inputs and outputs tables.

bash
cd modules/audited-bucket
terraform-docs markdown table --output-file README.md .

Output in README.md:

markdown
## Requirements
| Name | Version |
|------|---------|
| terraform | >= 1.6 |
| aws | ~> 5.0 |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|----------|
| name | Bucket name | string | n/a | yes |
| tags | Resource tags | map(string) | {} | no |
## Outputs
| Name | Description |
|------|-------------|
| id | Bucket id |

Use it in pre-commit (see tf-fmt-validate-ci) or CI. Every time variables or outputs change, the README is updated automatically.

Comparison

ToolOutput typeUse caseDependencies
RoverWeb UIInteractive exploration, presentationNone (single binary)
tf-summarizeText/MDPR comment, CI summaryNone
terraform-docsMarkdownAuto-README for a moduleNone
terraform graph + dotStatic PNGOne-off documentationGraphviz

All four tools complement each other rather than replace one another.

CI integration

In pre-commit config:

yaml
- repo: https://github.com/terraform-docs/terraform-docs
  rev: v0.19.0
  hooks:
    - id: terraform-docs-go
      args:
        - markdown
        - table
        - --output-file
        - README.md
        - ./modules/

In a GitHub Action for tf-summarize:

yaml
- run: |
    terraform plan -out=plan.tfplan
    go install github.com/dineshba/tf-summarize@latest
    tf-summarize -md plan.tfplan > summary.md
- uses: actions/github-script@v7
  with:
    script: |
      const fs = require('fs');
      const summary = fs.readFileSync('summary.md', 'utf8');
      github.rest.issues.createComment({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        body: summary,
      });

Pitfalls

  • Rover requires a plan file for interactive mode. Without one, it renders only state. For a pre-apply view, you need plan.tfplan.

  • terraform-docs depends on accurate variable descriptions. If a description field is empty, the README shows "n/a". The tool cannot fix that; the author must.

  • tf-summarize shows counts, not the actual diff. To inspect the change details, use terraform show plan.tfplan or terraform-plan-md.

  • Rover does not work with a remote backend unless you have local state. Pull state before running: terraform state pull > state.json.

  • terraform-docs hooks in pre-commit may regenerate README on every commit. When variables have not changed, the regeneration is a no-op, but it adds commit noise. The fix: configure terraform-docs-go to run only when .tf files are modified.

§ commands

bash
rover -tfPath . -planPath plan.tfplan

Start Rover on :9000. Press CTRL-C to stop.

bash
tf-summarize plan.tfplan

Print a table summarizing plan changes.

bash
tf-summarize -md plan.tfplan > summary.md

Write the summary in Markdown format, ready for a PR comment.

bash
terraform-docs markdown table --output-file README.md .

Generate a README with inputs and outputs tables.

bash
terraform graph | dot -Tsvg > graph.svg

Static graph with no external tools beyond Graphviz.

§ see also