TF Plans: From JSON to Zen
Overview: Why is this cool?
Alright, let’s be real. Terraform plan outputs in JSON format are a mess to review. Especially in a PR, trying to parse through lines of add, change, remove blocks in a scrollable text area is a nightmare. I’ve spent countless hours, or worse, just skimmed over critical changes because it was too painful. This tool, tfplan2md, is an absolute game-changer. It takes that monster JSON and spits out beautiful, human-readable markdown. Suddenly, spotting a misconfigured resource or an unintended change becomes trivial. It’s like someone finally heard our collective screams for better infrastructure-as-code review tools. This solves the ‘Terraform plan review fatigue’ big time for me!
My Favorite Features
- Markdown Output: Generates clean, structured markdown. Makes reviewing actual changes in resources (like arguments, names, types) incredibly easy. No more hunting for diffs in a wall of JSON.
- Resource Highlighting: Clearly distinguishes between added, changed, and removed resources. The visual cues are on point, reducing cognitive load significantly.
- Diff Details: Shows specific attribute changes with clear old/new values. This is crucial for catching subtle configuration errors or accidental deletions.
- No Dependencies: It’s a single executable (C# powered, super efficient). Drop it into your CI/CD pipeline and ship it. No complex setup, no flaky external deps.
- Flexible Input: Takes JSON plan output directly. Seamless integration into existing Terraform workflows.
Quick Start
Seriously, getting this running was hilariously easy. I just grabbed the latest release binary from the GitHub page, generated my Terraform plan as JSON (terraform plan -out=tfplan -json > tfplan.json), and then ran tfplan2md -plan tfplan.json > review.md. Boom! Instant, beautiful markdown. Dropped that review.md into a PR comment or attached it, and suddenly, reviews were a breeze. For CI/CD, it’s a one-liner to integrate.
Who is this for?
- DevOps Engineers: Anyone managing Terraform state and needing clearer PR reviews for infrastructure changes. Essential for ensuring infrastructure reliability.
- Platform Teams: Great for standardizing and improving the quality of infrastructure code reviews across larger teams. Reduces friction and speeds up deployments.
- Compliance/Audit Teams: Provides a human-readable artifact of planned infrastructure changes, making audits and compliance checks much simpler.
- Anyone using Terraform: If you’re using Terraform, you NEED this. Period.
Summary
Look, I’m all about tools that make a dev’s life easier, especially when it comes to infrastructure-as-code. tfplan2md isn’t just a nice-to-have; it’s a fundamental improvement to the Terraform workflow. It turns a tedious, error-prone task into a clear, efficient process. This is going straight into my CI/CD pipeline on every single project that uses Terraform. The DX is off the charts. Huge props to oocx for building this. Go check it out, you won’t regret it!