AWS Builder Center
5 Hidden AWS Cost Leaks Every Developer Overlooks (And How to Fix Them in 10 Minutes)

5 Hidden AWS Cost Leaks Every Developer Overlooks (And How to Fix Them in 10 Minutes)

Accidental AWS bills often come from forgotten resources rather than high traffic. Here is a breakdown of 5 common cost leaks—unattached EBS volumes, NAT Gateway data traps, and idle endpoints—with simple CLI checks to stop wasting credits.

Every AWS builder has experienced that moment of panic: opening the AWS Cost Explorer and seeing a sudden spike for a side project or sandbox environment that should have cost next to nothing.
When your bill climbs, it is rarely because of an EC2 instance you actively use. More often, it is the invisible, lingering resources left behind after experimentation.
Here are five of the most common AWS cost leaks and the exact steps to eliminate them.



1. Unattached Elastic Block Store (EBS) Volumes

When you terminate an EC2 instance, attached EBS volumes do not always delete automatically—especially if Delete on Termination was disabled during setup. These orphan volumes sit idle, quietly accruing monthly gigabyte-hour storage charges.
How to find them: Run this AWS CLI command to list all volumes currently in an  available  (unattached) status:
aws ec2 describe-volumes \
--filters Name=status,Values=available \
--query "Volumes[*].{ID:VolumeId,Size:Size,Type:VolumeType,Created:CreateTime}" \
--output table
Fix: Create a snapshot if you need the data, then delete the unused volume. To automate this, set up an AWS Config rule ( ec2-volume-inuse-check ) to notify you whenever a volume becomes detached.

2. The NAT Gateway Data Processing Trap

A single NAT Gateway costs roughly $0.045/hour (~$32/month) just to exist, plus $0.045 per GB of data processed. If your Lambda functions or private subnet EC2 instances download large dependencies (like Docker images from Amazon ECR or datasets from Amazon S3) through a NAT Gateway, you pay data processing fees twice.
Fix: Use VPC Gateway Endpoints for Amazon S3 and DynamoDB:
  • Gateway Endpoints are 100% free.
  • Traffic routes directly through AWS internal networks without passing through the NAT Gateway.
You can configure this under VPC Console > Endpoints > Create Endpoint > Services (com.amazonaws.[region].s3).

3. Orphaned Elastic IPs (EIPs)

AWS does not charge for Elastic IP addresses that are actively associated with a running EC2 instance. However, AWS does charge a small hourly penalty fee for every EIP allocated to your account that is either unattached or attached to a stopped instance.
How to find them:
aws ec2 describe-addresses \
--query "Addresses[?AssociationId==null].{IP:PublicIp,AllocationId:AllocationId}" \
--output table
Fix: Release any unassociated IP addresses immediately via CLI:
aws ec2 describe-vpc-endpoints \
--query "VpcEndpoints[?VpcEndpointType=='Interface'].{Id:VpcEndpointId,Service:ServiceName}" \
--output table

5. Multi-AZ Development Databases Left on 24/7

A Multi-AZ Amazon RDS or Aurora instance doubles compute and storage costs to provide failover redundancy. While vital for production, it is rarely needed in a staging, development, or personal project environment.
Fix:
  1. Switch non-production databases to Single-AZ.
  1. For intermittent workloads, use AWS Instance Scheduler or automated EventBridge rules with Lambda to shut down non-production RDS instances outside working hours (e.g., 7 PM to 7 AM and weekends), saving roughly 65% on compute costs.
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