Sign inSign up

aatir0docking/plan-parse

By aatir0docking

•Updated 7 days ago

Image
0

2.6K

aatir0docking/plan-parse repository overview

plan-parse banner

GitHub Repo Architecture License Issues Welcome

⁠plan-parse

plan-parse is an interactive, browser-based visualizer for Terraform and OpenTofu execution plans. It transforms dense JSON plan outputs into clear, hierarchical Cytoscape Directed Acyclic Graphs (DAGs), enabling platform and DevOps engineers to audit infrastructure changes, trace blast radius, and inspect resource diffs before running terraform apply.


⁠Key Features

  • Interactive Plan DAG: Explorable node-edge graph rendered with Cytoscape.js and Klay hierarchical layout.
  • Action Color Coding: Instant visual distinction for Create (+), Update (~), Delete (-), Replace (+/-), and No-Op resources.
  • Blast Radius Analysis: Trace direct and transitive multi-hop dependency impacts (upstream and downstream) across your infrastructure.
  • 2-Tier IaC Diff Viewer: In-canvas popover inspection and full side-by-side before/after attribute diffs.
  • Targeted Apply Generator: Quickly generate and copy terraform apply -target=... commands for selected resources and entire modules.
  • Search & Command Palette: Quick filter and navigate nodes using keyboard shortcuts (⌘K / Ctrl+K).
  • Terraform & OpenTofu Compatible: Seamlessly parses JSON plan exports from both Terraform and OpenTofu.
  • Self-Contained: Embedded Next.js UI, compiled Go server, and Terraform CLI bundled into a single lightweight container.

⁠Image Specifications

PropertyDetails
Base Imagealpine:3.20
Architectureslinux/amd64, linux/arm64
Security UserNon-root appuser:appgroup (UID/GID 10001)
Bundled ToolHashiCorp Terraform 1.16.2 (/usr/local/bin/terraform)
CompatibilityHashiCorp Terraform JSON plans & OpenTofu JSON plans
Default Port9000 (HTTP)
Endpoints/api/health, /api/status, /api/graph, /api/parse
DependenciesNone (no external database or node runtime required)

⁠Download the Image

Pull the latest multi-arch image from Docker Hub:

docker pull aatirnadim/plan-parse:latest

Tip: For immutable production pipelines, you can also pin to specific commit SHA tags published by CI (e.g. aatirnadim/plan-parse:<commit-sha>).


⁠How to Use

⁠1. Web Workbench (Ad-hoc Plan Upload)

Launch the server in standalone mode and upload Terraform or OpenTofu plan JSON files directly through the browser:

docker run -d --name plan-parse -p 9000:9000 aatirnadim/plan-parse:latest

Open http://localhost:9000⁠ in your browser to drag and drop your plan.json.


⁠2. Live Terraform Directory Mode (-dir)

Run directly against a local Terraform configuration directory. plan-parse generates temporary plan files inside the container's /tmp directory, making read-only (:ro) mounts completely safe:

docker run --rm -it \
  -p 9000:9000 \
  -v $(pwd):/infra:ro \
  -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
  -e AWS_REGION=$AWS_REGION \
  aatirnadim/plan-parse:latest -dir /infra -addr 0.0.0.0 -no-browser

Notes & Tips:

  • Ensure you have executed terraform init locally on your host beforehand so provider plugins are present in .terraform.
  • Cross-Platform Host Notice: If running on macOS or Windows, local provider plugins in .terraform may be Darwin/Windows binaries and won't execute inside the Linux container. In that case, use Mode 3 below to export the plan JSON on your host, which works seamlessly everywhere.
  • For GCP, mount service credentials via -v ~/.config/gcloud:/home/appuser/.config/gcloud:ro or -e GOOGLE_APPLICATION_CREDENTIALS. For Azure, supply standard ARM_* environment variables.

⁠3. Pre-Rendered Plan File Mode (-plan)

Parse a pre-computed Terraform or OpenTofu plan JSON export. This mode works universally across all host operating systems without requiring cloud credentials inside Docker:

# 1. Generate binary plan & export to JSON (Terraform or OpenTofu)
terraform plan -out=tfplan
terraform show -json tfplan > plan.json

# (For OpenTofu: tofu plan -out=tfplan && tofu show -json tfplan > plan.json)

# 2. Launch visualizer
docker run --rm -it \
  -p 9000:9000 \
  -v $(pwd)/plan.json:/app/plan.json:ro \
  aatirnadim/plan-parse:latest -plan /app/plan.json -addr 0.0.0.0 -no-browser

⁠Issues, Suggestions & Contributing

Encountered an issue or have a feature suggestion?

Contributions and feedback are always welcome!


⁠License

Distributed under the MIT License⁠.

Tag summary

Content type

Image

Digest

sha256:297d90429…

Size

42.5 MB

Last updated

7 days ago

docker pull aatir0docking/plan-parse