tfsummary
v1.1.0
Published
Beautify Terraform plan output with cost estimates
Downloads
290
Maintainers
Readme
tfsummary
Beautify Terraform plan output with built-in AWS cost estimates.
Features
- Colored terminal output with resource diffs
- HTML dark-themed reports
- GitHub PR-ready markdown output
- Built-in AWS cost estimates (no external tools required)
- Accurate fixed-cost pricing for EC2, RDS, ALB, NAT Gateway, EBS
- Usage-based resources (S3, SQS, Lambda) labeled honestly
- Destructive change warnings
- Field-level diffs for updated resources
- Reads from file or stdin pipe
Installation
npm install -g tfsummaryQuick Start
# Generate a plan JSON
terraform plan -out=tfplan
terraform show -json tfplan > plan.json
# View summary in terminal
tfsummary plan.json
# Pipe from terraform
terraform show -json tfplan | tfsummary
# Specify AWS region for pricing
tfsummary plan.json --region us-west-2Usage
Usage: tfsummary [options] [plan-file]
Beautify Terraform plan output with cost estimates
Arguments:
plan-file Path to terraform show -json output file
Options:
-V, --version output the version number
-f, --format <format> Output format: terminal, html, markdown, json (default: "terminal")
-o, --out <file> Write output to file instead of stdout
-r, --region <region> AWS region for cost estimates (default: "us-east-1")
--summary-only Show only the summary, hide per-resource list
-h, --help display help for commandOutput Formats
Terminal (default)
tfsummary plan.jsonColored output with action icons, field diffs, and cost estimates.
HTML Report
tfsummary plan.json --format html --out report.htmlDark-themed HTML report suitable for sharing or embedding.
Markdown (for PRs)
tfsummary plan.json --format markdownGitHub-flavored markdown with tables, diff blocks, and caution callouts for destructive changes.
JSON
tfsummary plan.json --format jsonParsed resource data as JSON for programmatic use.
Cost Estimation
tfsummary includes built-in AWS pricing data — no external tools or credentials required.
Fixed-cost resources (priced automatically):
- EC2 instances (47 instance types)
- RDS instances (PostgreSQL, MySQL, MariaDB)
- Application & Network Load Balancers
- NAT Gateways
- EBS volumes
- ElastiCache nodes
- Elastic IPs
Usage-based resources (labeled as such):
- S3, SQS, SNS, Lambda, DynamoDB, CloudWatch, API Gateway, CloudFront
Free resources (no cost shown):
- IAM roles/policies, Security Groups, VPC, Subnets, Route53 records, ACM certificates, ECR, Secrets Manager
Pricing covers 12 AWS regions with regional multipliers applied automatically.
GitHub Actions
Add the included workflow to automatically comment plan summaries on PRs that modify Terraform files. Copy .github/workflows/terraform-summary.yml to your repo.
The workflow:
- Runs
terraform planon PRs that touch.tfor.tfvarsfiles - Generates a markdown summary with cost estimates
- Posts a sticky comment on the PR
License
MIT
