The short version
- 4,445 public Terraform repositories scanned, 2,268 with AWS resources, 740 analysed as deployments (the rest are reusable modules or demos, reported separately in the dataset).
- Network: 76% of deployments with a NAT gateway have no S3 gateway endpoint, so S3 traffic pays NAT data processing at $0.045 per GB. The gateway endpoint is free.
- Old versions: 65% of EKS cluster definitions and 37% of RDS and Aurora definitions with a known version are in extended support, where EKS costs $0.60 instead of $0.10 per cluster-hour.
- Storage: 65% of deployments with S3 buckets have no lifecycle rule anywhere, and 67% with versioned buckets never delete old versions.
- Compute: 91% of instance types and 81% of Lambda functions are x86; Graviton and Arm are listed by AWS at up to 20% less.
- Guardrails (context): 5% of deployments define an AWS Budget in code and 1% a Cost Anomaly Detection monitor.
1. What we scanned and how
The sample is every GitHub repository whose main language is HCL, with 3 or more stars, not a fork, and pushed since 1 June 2025. GitHub search returns at most 1,000 results per query, so we listed the population in eight star ranges: 4,470 repositories, of which 4,445 could be downloaded. Only Terraform files (.tf, .tfvars) and the first part of the README were read. Nothing was executed.
Each repository was parsed with an HCL parser. Values written as variables were resolved from the variable's default, the repository's own .tfvars files and, for local modules, the value the caller passes. This matters: 55 of the 123 out-of-support EKS versions below were only visible after resolution. Values that come from outside the repository (pipelines, workspaces, remote state) are invisible, so every share is a lower bound of how often the pattern is written down.
Repositories were classed as:
- deployment (757 with AWS resources; 740 once example and test folders are excluded): infrastructure meant to run somewhere;
- module (793): reusable libraries such as
terraform-aws-*; - demo (706): tutorials, workshops, book code, deliberately vulnerable labs, examples.
Folders named examples, test, fixtures, demo and similar were excluded inside every repository, and 22 near-duplicate repositories (80% or more identical files) were removed. The headline numbers are deployments only.
Accuracy was checked against the source code, finding by finding, in an AI-assisted review recorded in the published hand-check file. In two rounds, 30 random deployment repositories were drawn and every finding was compared with the code (106 and 69 findings); rules that were wrong in more than 1 case in 10 were fixed and the scan was rerun, and the one rule changed in the last round was rechecked on 12 new findings (12 correct). Two checks that could not reach that bar (unattached Elastic IPs, and Lambda functions without an explicit log group) are left out of the results below. The instance-type and Lambda-architecture shares are direct reads of the value written in the code and were not sampled. The record of each round is published with the code.
2. The numbers
Each share is of the items named in the row (repositories, clusters, instance types, functions, log groups) found in deployments that have the resource in question, not of all repositories.
| Check | In deployments | Share | What it costs |
|---|---|---|---|
| NAT gateway, no S3 gateway endpoint | 212 of 280 | 76% | S3 traffic pays NAT data processing, $0.045 per GB; a gateway endpoint has no charge |
| NAT gateway and DynamoDB, no DynamoDB gateway endpoint | 48 of 62 | 77% | Same: DynamoDB traffic through the NAT |
| EKS version past standard support | 123 of 190 | 65% | $0.60 instead of $0.10 per cluster-hour, about $438 instead of $73 a month per cluster |
| RDS or Aurora engine version in extended support | 75 of 204 | 37% | An extended support fee on top of the instance: per vCPU-hour for provisioned instances, per ACU-hour for Aurora Serverless v2 |
| ElastiCache Redis OSS 4 or 5 | 6 of 43 | 14% | ElastiCache Extended Support premium on the node price (pricing) |
| Repos with S3 buckets and no lifecycle rule | 241 of 370 | 65% | Data never moves to cheaper storage classes or expires |
| Repos with versioned buckets and no noncurrent version expiration | 138 of 207 | 67% | Every overwritten or deleted object is kept and billed |
| Lifecycle rules that never abort incomplete multipart uploads | 71 of 130 | 55% | Failed uploads are stored and billed until deleted |
| EBS volume types set to gp2 | 97 of 444 | 22% | gp2 $0.10 vs gp3 $0.08 per GB-month |
| EFS file systems with no lifecycle policy | 43 of 64 | 67% | Cold files stay in the Standard storage class |
| Instance types that are not Graviton | 1,295 of 1,417 | 91% | AWS lists Graviton instances at up to 20% less than comparable x86 |
| Lambda functions on x86 (the default) | 426 of 528 | 81% | x86 $0.0000166667 vs Arm $0.0000133334 per GB-second |
| CloudWatch log groups that never expire | 104 of 848 | 12% | Logs are stored and billed forever |
| VPC Flow Logs sent to CloudWatch Logs, not S3 | 46 of 65 | 71% | Compare the two delivery prices for your volume (CloudWatch pricing) |
| Repos with more than one multi-region CloudTrail trail | 7 of 28 | 25% | The first copy of management events is free; further copies are paid |
| Previous-generation instance families (m4, c4, r4 ...) | 22 of 1,417 | 2% | Good news: almost nobody pins these any more |
| AWS Budget defined in code | 38 of 740 | 5% | A guardrail, not a cost |
| Cost Anomaly Detection monitor in code | 9 of 740 | 1% | A guardrail, not a cost |
The NAT gateway rate is $0.045 per GB processed (VPC pricing); see NatGateway-Bytes on your AWS bill for how to find and fix it. The EKS rates are on the EKS pricing page; see EKS 1.34 end of support. gp2 and gp3 list prices are on the EBS pricing page. The Graviton statement is AWS's own (AWS Graviton). The Lambda duration prices are from the AWS Price List for US East (N. Virginia), first tier (usage types Lambda-GB-Second and Lambda-GB-Second-ARM); see Lambda pricing.
3. What stands out
The NAT gateway pattern is the most common and the cheapest to fix. Three in four deployments with a NAT gateway send S3 traffic through it. An S3 gateway endpoint is one Terraform resource, has no hourly or data charge, and the change is invisible to applications. It matters most for teams that pull container images or move data to S3 from private subnets, where the traffic is measured in terabytes.
Versions drift into paid support quietly. Two in three EKS cluster definitions pin a version that AWS no longer covers under standard support. In code this looks harmless (version = "1.29"), but on the bill it is six times the control-plane price. Database versions follow the same pattern at a lower rate. Both are the kind of change that waits for a sprint that never comes. Our deadline pages list the next dates.
Storage is configured to grow forever. Most deployments with buckets never move or expire data, and most with versioning keep every old version indefinitely. Neither costs much on day one; both compound.
Almost nobody puts cost guardrails in code. One deployment in twenty defines a budget; one in a hundred defines an anomaly monitor. Budget alerts are free and take one resource.
4. Limits of this study
- Public code is not production. Many public repositories are personal projects or templates even after our filtering. Read the shares as "how often the pattern is written", not "how much companies waste".
- Configuration is not spend. A NAT gateway with little S3 traffic costs little. The scan cannot see traffic, utilisation or commitments; that needs the account's billing data.
- Lower bounds. Values set outside the repository are invisible.
- Rules can be wrong. Each headline rule was hand-checked against code in samples of 30 repositories until it was right in at least 9 of 10 sampled cases, but rare configurations can still be misread. The scanner and rules are published so they can be checked.
5. Data and code
- Aggregate results by check and repository class: terraform-aws-cost-scan-2026.json (CC BY 4.0)
- The frozen list of repositories and commit SHAs: terraform-aws-cost-scan-2026-frame.json
- Scanner, checks, the check list and the hand-check record: terraform-aws-cost-scan-2026-scanner.tar.gz (Python; no repository is named in the results)
6. Have it done for you
The scan shows what is written in code; finding what it actually costs in your accounts takes the billing data, and fixing it takes pull requests someone has time to review. FinOps, paid from savings: a one-month engagement with savings in the bill within 30 days. The fee is one month of the measured saving, invoiced once; every month after is the client's. No savings, no payment. AWS, Azure and Google Cloud, any account size. Get a free savings assessment. Prefer to do it yourself? Compass is open source (Apache 2.0) and finds AWS cost waste with a savings estimate per finding.
7. Sources
- AWS VPC pricing (NAT gateway)
- Amazon EKS pricing
- Amazon EBS pricing
- AWS Graviton
- AWS Lambda pricing
- Amazon ElastiCache pricing
- Amazon CloudWatch pricing
- Amazon EC2 previous generation instances
- Gateway endpoints for Amazon S3
- GitHub search: repositories
8. FAQ
What are the most common AWS cost mistakes in Terraform?
In our scan of public Terraform deployments: NAT gateways without an S3 gateway endpoint (76% of setups with a NAT gateway), EKS versions past standard support (65% of cluster definitions), versioned S3 buckets that never expire old versions (67%), buckets with no lifecycle rule (65%) and Lambda functions left on x86 (81%).
How much does an EKS cluster in extended support cost?
$0.60 per cluster per hour at list price, against $0.10 in standard support: about $438 a month instead of $73 for each cluster, before any nodes.
Does an S3 gateway endpoint cost anything?
No. A gateway VPC endpoint for S3 or DynamoDB has no hourly or data processing charge, while the same traffic through a NAT gateway pays $0.045 per GB processed in US East (N. Virginia).
Can I run this scan on my own Terraform?
Yes. The scanner is published with the data. It reads .tf and .tfvars files, resolves variables where it can, and reports each check with the resources it matched.
Does this tell me how much I am wasting?
No. It shows configuration that makes waste likely. The amount depends on traffic, data volume and utilisation, which are in your billing data, not in your code.
Last checked: 30 November 2026. Scan of public repositories frozen on 30 November 2026 (commit SHAs in the dataset). Prices are AWS list prices in US East (N. Virginia).
Related: FinOps Watch · How to reduce AWS costs: the checklist · FinOps paid from savings
Beamreach