Infracost
An open source tool that shows the monthly cost of Terraform, CloudFormation or CDK changes before they are deployed, as a comment on the pull request or inline in your editor, for AWS, Azure and Google Cloud. The easiest way to bring cost into code review.
Tool
Other
Infracost
An hour to set up
Intermediate
Free
What it is
Infracost is a cost estimation tool for infrastructure as code. It reads a Terraform plan (and, through its cloud product, CloudFormation and AWS CDK), looks up public prices for AWS, Azure and Google Cloud, and tells you what the change will add to the monthly bill. The command-line tool is open source on GitHub; Infracost Cloud adds team features and has a free tier.
Why it matters for FinOps
Most cloud waste is created at the moment someone merges an infrastructure change: a larger database size, a NAT gateway per zone, logs kept forever. By the time a monthly report shows it, the change is weeks old and nobody remembers why. Infracost moves the cost conversation to the pull request, where it is cheapest to fix. This is often called "shifting cost left".
What it does
- Posts a comment on a pull request with the cost difference of the change, resource by resource.
- Shows costs inline in editors such as VS Code and JetBrains IDEs.
- Flags FinOps policy issues such as missing required tags or older, more expensive instance types.
- Runs in CI systems including GitHub Actions, GitLab CI and Azure DevOps.
How to learn with it
Take a small Terraform project, such as the three-tier app from the cloud engineering roadmap. Run infracost breakdown on it, then change one resource size and run infracost diff. Add the GitHub Action so every pull request gets a cost comment. Finally, note what it cannot know: usage-based costs like data transfer and requests need a usage file with your own estimates.
Prerequisites and time
Basic Terraform. Installing the CLI and getting a first estimate takes under an hour; wiring it into CI takes an afternoon.
Free or paid
The CLI is free and open source. Infracost Cloud has a free tier and paid plans for larger teams; check the pricing page for current limits.
Best for: engineers who write infrastructure code and want cost to be part of code review, and FinOps people who want to prevent waste rather than report it.
Ready to start?
Opens on Infracost in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.