-
-
Notifications
You must be signed in to change notification settings - Fork 2
Terraform Plan Parser — Developer & Usage Guide
A lightweight Rust CLI for transforming raw Terraform plan output into clear, actionable summaries.
This tool is designed for both humans and pipelines:
-
Humans get readable, noise-free output
-
CI systems get structured, enforceable signals
Terraform plans are powerful but hard to read at scale.
This parser:
-
Extracts meaningful changes (create, update, delete)
-
Filters out noise (like read-only actions)
-
Produces clean summaries for quick review
-
Enables CI/CD enforcement via exit codes
terraform_plan_parser ./my-project
terraform_plan_parser --plan-file plan.json
terraform plan -json | terraform_plan_parser
The parser supports multiple input modes:
-
Terraform execution (default)
-
Plan file (
--plan-file) -
stdin piping
Priority: stdin > plan-file > terraform execution
Each resource change is categorized as:
-
create→ new infrastructure -
update→ modification -
delete→ destruction -
read→ no-op (data sources / refresh)
Large plans can be overwhelming. Filtering helps isolate what matters.
Examples:
--filter-action create,update
--filter-changed-only
--include-type aws_instance
--exclude-module module.test
The tool supports both human and machine-friendly formats:
-
text→ default readable output -
json→ structured output for automation
Additional controls:
-
--no-emoji -
--quiet -
--verbose
This tool is designed to integrate directly into pipelines.
Example: Fail on destructive changes
terraform_plan_parser --fail-on delete
Example: Save output as artifact
terraform_plan_parser --output-file summary.txt
GitHub Actions integration
-
Automatically writes to
$GITHUB_STEP_SUMMARYwhen available -
Provides readable plan summaries in PR workflows
+ aws_instance.web_server (create)
~ aws_security_group.main (update)
- aws_s3_bucket.old_logs (delete)
Summary:
1 to create, 1 to update, 1 to delete
The system is intentionally simple and modular:
1. Input Layer → Terraform / file / stdin
2. Parser Layer → JSON → internal structs
3. Filter Layer → applies user-defined constraints
4. Renderer Layer → text / JSON output
See docs/architecture.md for full details.
The project is evolving across several phases:
-
v0.2 → CLI foundation (input, filtering)
-
v0.3 → CI & automation features
-
v0.4 → UX & polish
-
v1.0 → distribution & installation
-
vNext → advanced analysis (diffing, state support)
Contributions are welcome.
Before opening a PR:
-
Check existing issues and milestones
-
Follow the CLI design principles (simple, fast, predictable)
-
Prefer small, focused changes
This tool prioritizes:
-
Clarity over completeness
-
Speed over abstraction
-
Practicality over perfection
If a feature doesn't make plans easier to understand or automate, it probably doesn't belong.
See the LICENSE file for details.