Most DevOps engineers have run terraform plan thousands of times. Very few have looked at what comes out when you add the -json flag. I spent a couple of weeks inside that JSON output while building tfdrift , an open-source drift detection tool. What I found was a surprisingly well-structured format — and a handful of gotchas that aren't documented anywhere obvious. This post is the technical deep-dive I wish I'd had when I started. If you're building any kind of tooling on top of Terraform — drift detection, policy enforcement, cost estimation, change analysis — this is the stuff you'll need to know. Getting the JSON output First, the basics. You can't just pipe terraform plan to get JSON. The text output and the JSON output are completely different codepaths.…