Cloud Cost Engineering and Open Source FinOps
Notes from the team building C3X. Cost estimation for Terraform, the economics of cloud infrastructure, and how to ship FinOps tooling without a SaaS gate.
AWS CDK cost estimation: price the synthesized CloudFormation
CDK synthesizes to CloudFormation, so you estimate cost from the synth output, run cdk synth, then price the templates in cdk.out. Here's how to get a cost per stack before cdk deploy, locally and in CI.
GitHub Actions Terraform cost estimation: cost on every pull request
Add a job that runs after terraform plan, prices the plan JSON, and comments the monthly total and diff on the PR, with a budget gate that fails the check. Here's the workflow, the input that keeps it accurate, and how to keep it fast.
OpenTofu cost estimation: price your infrastructure from tofu plan
OpenTofu emits the same plan JSON as Terraform, so cost estimation works unchanged, run tofu show -json and price it. Here's how to estimate OpenTofu cost locally and in CI, and what stays identical after the fork.
Terraform Cloud cost estimation with a run task (HCP Terraform)
HCP Terraform fires run tasks at post-plan, the moment the plan JSON exists. A run task that prices that plan puts cost and a budget gate directly in the Terraform Cloud UI. Here's how the integration works.
Azure DevOps Terraform cost estimation in your pipeline
Add a pipeline step after terraform plan that prices the plan and posts it as a PR comment, with a budget gate that fails the build. Here's the YAML, the plan-JSON input, and how it fits branch policies.
API Gateway REST vs HTTP API cost: when the cheaper one costs more
HTTP APIs are $1.00 per million requests versus $3.50 for REST, about 70% cheaper. But REST's caching, usage plans, and request validation can make the 'expensive' option the cheaper system. Here's the real comparison.
AWS Config cost explained: you're billed per change, not per resource
AWS Config bills ~$0.003 per configuration item (recorded on every resource change) plus rule evaluations. The bill is churn × recording scope. Here's how to scope recording so Config stays cheap.
Terraform plan JSON cost estimation: the most accurate input
Estimating from terraform show -json prices the resolved resources, variables, conditionals, data sources all computed, unlike parsing raw HCL. Here's how to generate it, why it's accurate, and how it fits CI.
Atlantis Terraform cost estimation: add cost to your PR workflow
Atlantis already plans on every PR, add a post-plan workflow step that estimates cost and comments it, with a budget gate that blocks apply. Reuses the existing plan, works self-hosted and air-gapped.
Reserved vs on-demand: a decision framework, not a guess
Commit when utilization clears the break-even (~60-70% for a 1-year term). Here's how to calculate it, when to ladder 1- vs 3-year, how to avoid stranding, and where Spot fits.
Cloud cost estimation before deploy: turn the bill into a leading indicator
The monthly bill is a lagging indicator. Estimating cost in the pull request puts the number where the change is still cheap to fix. Here's why shift-left cost works and what it can and can't predict.
Terraform cost policy as code: enforce budgets, not reminders
Encode cost rules, budget thresholds, per-PR deltas, required tags, banned SKUs, as machine-enforced policies in CI against a cost estimate. Here's the policy set worth having and how to roll it out.
Monorepo Terraform cost estimation: estimate per stack, scoped to the change
Don't estimate a whole monorepo on every PR. Detect changed stacks, estimate only those in a CI matrix, and aggregate. Here's the pattern that keeps CI fast and attributes cost to the right stack.
Data transfer cost across clouds: the line item that varies most
Compute and storage have converged, but data transfer hasn't. Here's the shared structure (ingress free, egress tiered, cross-region charged), where AWS/Azure/GCP diverge, and the universal levers to cut it.
Compute Savings Plans vs EC2 Instance Savings Plans: flexibility vs depth
Compute Savings Plans give ~66% off across families and Fargate/Lambda; EC2 Instance Savings Plans give ~72% locked to one family/region. Here's which to pick and how they differ from Reserved Instances.
Azure egress bandwidth cost: first 100 GB free, then it adds up
Azure egress is free for the first 100 GB/month, then tiered ~$0.087/GB; ingress is free. Here's the egress map, the patterns that drive the bill, and how a CDN and region co-location cut it.
GCP Bigtable cost optimization: the per-node floor that decides it
Bigtable bills nodes (~$474/month each, minimum one) + storage. The node floor makes it expensive below scale. Here's how to tune nodes, SSD vs HDD, and when a cheaper datastore wins.
CloudWatch custom metrics cost: cardinality is the whole bill
Custom metrics are $0.30/metric/month, but each metric-name + dimension-value combination is a separate billable metric, so high cardinality explodes the bill. Here's how to control it.
How to reduce your cloud bill: the checklist that works, in order
Delete waste, right-size, commit the baseline, use Spot, tier storage, cut egress, then keep it down with a cost gate. A practical, impact-ordered checklist with links to the details for each step.
FinOps for startups: the lightweight version that actually fits
Startups need budget alerts, basic tagging, and cost in the PR, not a FinOps team. Here's the starter kit, when to buy commitments, the common traps, and why not to over-engineer it.
Cloud cost anomaly detection: a safety net, not prevention
Native anomaly detection (AWS/Azure/GCP, free) alerts on spend spikes, but reactively, after the money's spent. Here's its limitation and why estimating cost in PRs prevents the IaC-driven spikes.
AWS Global Accelerator cost: the per-GB premium, and when it's not a CDN
Global Accelerator is $18/month per accelerator plus a per-GB data-transfer premium. Here's what it's for (anycast IPs, failover, latency), why it's not CloudFront, and how to keep the premium intentional.
Amazon FSx cost comparison: Lustre vs Windows vs ONTAP vs OpenZFS
FSx has four file system types, each billing storage plus throughput. Here's what Lustre, Windows File Server, NetApp ONTAP, and OpenZFS cost, which to use, and how to avoid over-provisioning throughput.
Azure Application Gateway vs Load Balancer cost: L7 vs L4
Load Balancer (L4) is ~$25-40/month; Application Gateway (L7) starts ~$180/month plus capacity units. Here's what the gap buys, when you need L7, and how to avoid defaulting to the pricier option.