Go CLI that recursively scans Terraform and Terragrunt root modules, runs init+plan in parallel, and reports which directories have drifted from recorded state. Built for CI gating and local audits.
driftlens is a Go CLI tool that solves a common pain point in multi-module Terraform repositories: knowing which directories have drifted from their recorded state without running plan across each one manually. It recursively discovers every Terraform and Terragrunt root module under a given path, then executes init and plan across all of them concurrently using a bounded worker pool. Results are aggregated and surfaced as a human-readable console table, machine-readable JSON, or styled HTML/PDF reports. Exit codes mirror Terraform's own -detailed-exitcode convention so CI pipelines can gate on drift without any extra scripting.
Key Features
Recursive module discovery finds every *.tf and terragrunt.hcl root
Parallel execution with configurable worker pool (--parallelism)
Supports both Terraform and Terragrunt via --tool flag
Per-resource drift detail with --detailed flag (plan JSON parsing)
HTML report with client-side search and status filter buttons
PDF report via pure-Go engine, no external binary required