Reading a Terraform plan and pricing a handful of resource types is a weekend job: an agent can parse the plan JSON, load AWS's public price lists, show a monthly before-and-after and comment on pull requests. The gap is coverage. Infracost prices over a thousand resource types across AWS, Azure and Google Cloud, including usage-based ones, and keeps that data current, while a home-built tool covers the few services you use. The paid tiers add policies, dashboards and audit trails for teams. For one repo on AWS a small script is realistic; for anything wider, the free plan costs less than your time.
Before you buildInfracost's free CI/CD plan covers 1,000 runs a month and its CLI is open source, so a solo repo rarely needs the $250 Starter plan. Check the free plan first.
Build me a small cloud cost estimator for my Terraform to replace Infracost Cloud. Requirements: - Node.js 22 + TypeScript. A CLI called `tfcost` (`commander`). Input is a plan JSON I make with `terraform show -json plan.out`; it never runs Terraform itself. - Priced resources, AWS only: aws_instance, aws_ebs_volume, aws_db_instance (including Multi-AZ), aws_nat_gateway, aws_lb, aws_eip, and aws_s3_bucket and aws_lambda_function from a usage.yml I write (default zero). Every other resource type appears under "not priced" with its count, never skipped silently. - Prices: AWS's public Price List bulk files, downloaded per service and region on first use into ~/.tfcost/ and loaded into better-sqlite3 (prices.db), keeping only the SKUs those resource types need. Stream-parse the files, since they are too big to hold in memory. `tfcost update` refreshes them; every report shows the price date. - Maths: 730 hours a month, on-demand Linux, no reserved or spot pricing, no tax, no data transfer. Print these assumptions at the bottom of every report. - Compare: `tfcost diff base.json head.json` prints each resource's monthly cost before and after with the total change, and exits with code 1 when the increase is above `--fail-above <dollars>`. - Output: a terminal table, `--format markdown` for a pull-request comment, and `--format json`. - GitHub: a workflow in .github/workflows/ that plans the base and head branches, runs `tfcost diff` and creates or updates one comment, found by a hidden marker, using `gh api` and GITHUB_TOKEN. - Tests: three fixture plans (EC2 with EBS, RDS Multi-AZ, a NAT gateway) checked against totals that I work out by hand from the price list and write into the test file. - Single user. No accounts, no telemetry; the only network calls are the AWS price files and the GitHub API. - Out of scope: Azure and Google Cloud, CloudFormation and CDK, dashboards, approval flows, SSO, usage from bills. - README: setup, the assumptions, how to add a resource type, and an honest note that this prices a few resource types and its totals can differ from the real bill and from Infracost's.
Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own Infracost Cloud.
Add policy checks to the cost estimator in this folder. Requirements: - A .tfcost.yml file with a monthly budget per workspace and a list of rules: allowed instance families, banned storage types such as gp2, and required tags on listed resource types. - `tfcost check head.json` prints each violation with the resource address, the rule and a one-line fix, and exits with code 1 if any rule marked severity error fails. - Rules with severity warning appear in the pull-request comment without failing the run. - An allow-list entry in the file can silence one resource address, with a required reason and an expiry date; expired entries fail the check. - Update the README with the rule format and three example rules.
Extend the cost estimator in this folder with more AWS resources. Requirements: - Add aws_dynamodb_table (on-demand and provisioned), aws_sqs_queue, aws_cloudwatch_log_group, aws_ecs_service on Fargate and aws_elasticache_cluster. - Usage-based ones read request counts, GB stored and GB ingested from usage.yml; a missing value is shown as zero and flagged "usage not set" in the report. - Each new resource type gets a fixture plan and a test whose expected total is worked out by hand from the price list, with the calculation in a comment. - `tfcost coverage plan.json` prints the share of resources in a plan that are priced. - Update the README with the resource table.
Add a cost history and digest to the cost estimator in this folder. Requirements: - A command `tfcost record head.json --pr <number>` that stores each merged pull request's monthly total and change in better-sqlite3 (history.db) with the repo, date and author. - `tfcost digest --month YYYY-MM` prints and optionally sends through ntfy a summary: total change, the five biggest increases and decreases, and the three resource types that grew most. - A workflow that runs the record step on merge and the digest on the first of each month. - Skip records with a missing price date and say so. - Update the README with the workflow files.
Teams buy it for governance more than for the estimate: platform and FinOps people set rules once, such as tagging or banned instance types, and have them enforced on every pull request across many repos, with a dashboard that shows where spend is heading.
Estimate · Runs on your machine or in your own GitHub Actions minutes, and the AWS price files are public and free. Keeping the prices and resource coverage current is your time. The build is token usage on your agent plan.
Checked 2026-10-19 against Infracost Cloud's docs: 1, 2, 3, 4, 5, 6
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| CI/CD (free) | $0 | $0 | Cost estimates for Terraform, CloudFormation and CDK; GitHub, GitLab and Azure DevOps integrations; 1,000 runs a month; Slack community support. |
| Starter | $250 | — | Everything in CI/CD with 10,000 runs a month and email support. |
| Cloud | $1,000 | — | Everything in Starter plus FinOps policies, custom price books, cost guardrails, Issue Explorer, autofix workflows, dashboards, team management and audit trails; 10 admin seats included, developer seats for an extra fee. |
| Enterprise | custom | — | Everything in Cloud plus GitHub and GitLab Enterprise support, SSO and SAML group mappings, SKU-level price overrides, reporting across business units, custom policies, SLAs and onboarding. |
The free CI/CD plan gives cost estimates in GitHub, GitLab and Azure DevOps pull requests for up to 1,000 runs a month.
Kinda. The core is a weekend build with the prompt on this page, but real gaps remain: Pricing for over 1,100 resource types across AWS, Azure and Google Cloud, kept current, Usage-based estimates for services like S3 and Lambda.
About $250 a month on the Starter plan, $3,000 a year (checked 2026-10-19).
Pricing for over 1,100 resource types across AWS, Azure and Google Cloud, kept current; Usage-based estimates for services like S3 and Lambda; FinOps policies, tagging rules and guardrail approvals across repos; Dashboards, audit trails and custom price books for negotiated discounts; GitLab and Azure DevOps integrations, editor plugins and agent skills. If any of those matter to you, keep paying.
Yes: Infracost CI/CD (free plan) (free), OpenCost (open source), OptScale (open source).