Skip to content

feat(cost): implement cost estimation#98

Merged
jkondrat merged 1 commit into
mainfrom
cost-estimation
Jun 24, 2026
Merged

feat(cost): implement cost estimation#98
jkondrat merged 1 commit into
mainfrom
cost-estimation

Conversation

@jkondrat

@jkondrat jkondrat commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Add AWS cost estimation to IaC scans

InfraScan now estimates monthly AWS infrastructure cost and potential savings directly from Terraform source files.

What's included:

  • Savings estimate - for each cost finding, calculates what the misconfiguration costs vs. the recommended fix, shown as a $low – $high / month range. Fleet-wide rules (e.g. Spot instances) are counted once and distributed per resource. Multiple findings on the same resource are capped at its actual cost.
  • Total infrastructure cost - bottom-up monthly cost for every billable resource (aws_instance, aws_db_instance, aws_nat_gateway, aws_lb, aws_lambda_function, 30+ types), split into fixed and usage-based charges. Traffic profile (small/medium/large) is auto-detected and scales usage defaults.
  • Variable inference - when instance_type or instance_class reference a Terraform variable, the scanner looks for literal values in locals/variable blocks and default declarations; falls back to a conservative price floor if unresolvable.

Output surfaces - savings headline and per-resource breakdown appear in:

  • Web UI (interactive cost table with confidence tooltips and assumptions)
  • PDF export
  • GitHub Actions step summary
  • PR comment (posted automatically when GITHUB_TOKEN is set) - also includes security findings
  • CLI text output

Pricing comes from a static us-east-1 on-demand table, updatable via update_pricing.py. See COST_ESTIMATION.md for supported rules, resource types, and limitations.

@igor-soldev

Copy link
Copy Markdown
Member

I noticed a possible layout issue in the cost estimation card (see screenshot). The Confidence column appears outside the main table area, suggesting that the table width exceeds the available container width or that the column sizing isn't aligned with the card boundaries.

I can reproduce this both in the web UI and in a locally generated HTML report.

Could you check whether the table is overflowing its parent container in this view?

obraz

@igor-soldev igor-soldev added the enhancement New feature or request label Jun 24, 2026
@jkondrat jkondrat merged commit fd22916 into main Jun 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants