AWS Builder Center

5 Subtle AWS Cost Traps Every Developer Falls Into (And How to Fix Them)

There is a universal rite of passage in cloud engineering: opening your monthly AWS bill, freezing for a second, and wondering how a minor side project or sandbox test accrued an unexpected charge. Most developers know about the big cost drivers like over-provisioned EC2 instances or massive RDS databases. But the real budget leaks often come from silent, low-level resources left running in the background.

Estudante de Ciência da Computação, buscando aprofundar conhecimento em Cloud Computing.

1. Unattached Elastic Block Store (EBS) Volumes

When you terminate an EC2 instance, attached EBS volumes are not always deleted automatically depending on your root volume settings and secondary attachments.
  • The Trap: These orphaned volumes sit in your account taking up storage space, quietly billing you every month for gigabytes of provisioned SSD capacity you aren’t using.
  • The Fix: Go to the EC2 Dashboard $\rightarrow$ Volumes. Filter by  State: available  (which means unattached). Snapshot any critical data you need, then delete the unused volumes.

2. Idle Elastic IP Addresses (EIPs)

AWS provides static IPv4 addresses, but their pricing model comes with a twist designed to encourage efficiency.
  • The Trap: AWS does not charge for an Elastic IP if it is attached to a running EC2 instance. However, if you stop or terminate the instance and leave the Elastic IP allocated to your account, AWS charges an hourly rate for holding that unused IP.
  • The Fix: Audit your Elastic IPs under EC2 $\rightarrow$ Network & Security $\rightarrow$ Elastic IPs. Release any IP that is not associated with an active running resource.

3. CloudWatch Logs with "Never Expire" Retention

CloudWatch automatically collects logs from Lambda functions, ECS tasks, and API Gateways.
  • The Trap: By default, CloudWatch log groups are set to "Never Expire". Over months of development and testing, gigabytes of verbose debug logs accumulate, leading to mounting ingestion and storage charges.
  • The Fix: Set a explicit retention policy (e.g., 7 or 14 days for development environments, 30–90 days for production) across all log groups, or configure automated lifecycle management.

4. 24/7 NAT Gateways in Staging & Dev VPCs

NAT Gateways allow resources in private subnets to reach the internet securely.
  • The Trap: NAT Gateways charge a fixed hourly fee just for existing, plus a per-gigabyte data processing fee. Keeping dedicated NAT Gateways running 24/7 across multiple non-production environments can cost over $30–$40/month per availability zone before transmitting any data.
  • The Fix: For non-production or sandbox environments, consider using VPC Endpoints for AWS services, or tearing down non-prod NAT Gateways outside of working hours using automated IaC scripts.

5. Leaving Old Assets in S3 Standard

Amazon S3 is famously inexpensive, but storing every build artifact, log dump, and user upload in S3 Standard indefinitely adds up quickly.
  • The Trap: Objects that haven't been accessed in months remain on the high-performance S3 Standard tier.
  • The Fix: Implement S3 Lifecycle Rules. Configure objects older than 30 days to automatically transition to S3 Glacier Flexible Retrieval or S3 Infrequent Access (IA), or set expiration rules for temporary build outputs.

The Takeaway

Cloud financial management (FinOps) isn't just for enterprise finance teams—it is an essential discipline for modern software engineers. Taking 10 minutes to audit your account today can prevent surprise bills tomorrow.
Over to you: What is the most unexpected line item you’ve ever discovered on your AWS bill? Let’s share our best cost-saving tips in the comments below! 👇
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article