The AWS bill that taught me more than any tutorial ever could.
The Mistake Every Beginner Makes
It was 2am.
I had just finished setting up my first production EC2 instance. Nginx configured. CI/CD pipeline working. Website live on the internet.
I was so excited I forgot one small thing.
I forgot to stop the instance.
For 30 days.
When I opened my AWS billing dashboard that month — my heart stopped for a second. I had been running a t2.micro instance 24 hours a day, 7 days a week, for an entire month without realizing it.
Today I'm sharing exactly what it cost me, what I learned, and how you can avoid the same mistake. 💸
My EC2 Setup — What Was Running
Before I share the numbers let me tell you exactly what I had running:
- Instance type: t2.micro (free tier eligible)
- Region: ap-south-1 (Mumbai)
- Operating system: Ubuntu 22.04 LTS
- What was on it: Nginx web server with a simple static website
- Storage: 8GB EBS gp2 volume
- Data transfer: Minimal — just occasional visits to the live site
This is as basic as EC2 gets. No database. No heavy processing. Just a simple web server running 24/7.
The Actual Bill — Real Numbers
Here's exactly what AWS charged me 👇
Compute (EC2)
- t2.micro instance — 744 hours running
- Free tier covers 750 hours per month
- I used 744 hours — technically within free tier! 😅
- Cost: $0.00
Storage (EBS)
- 8GB gp2 volume for 30 days
- Free tier covers 30GB per month
- Cost: $0.00
Data Transfer
- Outbound data transfer — minimal traffic
- Free tier covers 1GB outbound per month
- I used less than 100MB
- Cost: $0.00
Elastic IP
- I had attached an Elastic IP to keep consistent public IP
- Elastic IPs are FREE when attached to a running instance
- But if instance is stopped — AWS charges $0.005 per hour
- My instance was running so — Cost: $0.00
Total Bill: $0.00 ✅
Wait — So Nothing Bad Happened?
Correct. Because I was on free tier.
But here's the thing — I got extremely lucky.
Free tier only lasts 12 months from account creation. And it only covers ONE t2.micro instance.
If I had:
- Been past my 12 month free tier period
- Run a larger instance like t2.small or t2.medium
- Had multiple instances running
- Generated significant traffic
The story would be very different.
Let me show you exactly what it WOULD have cost in different scenarios. 💰
What It Would Have Cost — Real Scenarios
Scenario 1 — Past Free Tier (t2.micro)
Same setup but free tier expired:
- t2.micro in Mumbai = $0.0116 per hour
- 744 hours × $0.0116 = $8.63 per month
- In INR = approximately ₹720 per month
Not terrible. But it adds up over months.
Scenario 2 — Running t2.small
If I had used a slightly bigger instance:
- t2.small in Mumbai = $0.023 per hour
- 744 hours × $0.023 = $17.11 per month
- In INR = approximately ₹1,430 per month
Scenario 3 — Running t2.medium
A medium instance for development:
- t2.medium in Mumbai = $0.0464 per hour
- 744 hours × $0.0464 = $34.52 per month
- In INR = approximately ₹2,880 per month
Scenario 4 — The Horror Story
Running t2.medium + RDS database + high traffic:
- EC2 t2.medium: $34.52
- RDS db.t3.micro: $25.00
- Data transfer 10GB: $0.90
- Total: ~$60 per month = ₹5,000 per month
For a student or fresher with no income — ₹5,000 per month on a forgotten instance is genuinely painful.
The Developers Who Weren't So Lucky
My story ended with a $0 bill. But many developers aren't so lucky.
Here are real scenarios that happen constantly:
The Crypto Miner Attack
Developer pushes AWS credentials to GitHub → bots find them in seconds → spin up 50 GPU instances for crypto mining → $10,000 bill in 24 hours.
The Forgotten NAT Gateway
Developer sets up a NAT Gateway for testing → forgets to delete it → NAT Gateways cost $0.045 per hour → $32.40 per month just sitting there doing nothing.
The Data Transfer Surprise
Developer builds an app that transfers lots of data between regions → doesn't realize inter-region data transfer costs money → $200 bill at end of month.
The Snapshots Pile Up
Developer takes EBS snapshots for backup → never deletes old ones → 50 snapshots accumulate over months → significant storage costs.
These are real situations. They happen to real developers every week.
How to Protect Yourself — Complete Guide
Protection 1 — Set Up Billing Alerts Immediately
This is the single most important thing you can do right now.
1. Go to AWS Console → Billing → Budgets
2. Click "Create Budget"
3. Select "Cost Budget"
4. Set amount: $5 (₹420)
5. Add your email for alerts
6. Create Budget ✅
Now AWS will email you the MOMENT your bill approaches $5. You'll never be surprised again.
Also set up free tier alerts:
AWS Console → Billing → Billing Preferences →
Check "Receive Free Tier Usage Alerts" →
Enter your email ✅
Protection 2 — Always Stop Instances When Not Using
Develop this habit from day one:
Before closing your laptop — ask yourself:
"Is my EC2 instance stopped?"
# Check instance status
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,State.Name]' --output table
# Stop instance from terminal
aws ec2 stop-instances --instance-ids i-0abc123def456789
Or use the Python automation script from my Boto3 Part 2 article — automatically stop your instance every night at 10pm. 🎯
Protection 3 — Use AWS Cost Explorer Weekly
AWS Console → Cost Explorer → Enable it (free)
Check this every week. Takes 2 minutes. Shows you exactly where every dollar is going.
If you see something unexpected — investigate immediately before it grows.
Protection 4 — Delete Resources You Don't Need
After finishing a project or tutorial — clean up everything:
# Things to delete when done:
# ✅ Stop or terminate EC2 instances
# ✅ Release Elastic IPs
# ✅ Delete NAT Gateways
# ✅ Delete unused Load Balancers
# ✅ Clean up old EBS snapshots
# ✅ Empty and delete unused S3 buckets
# ✅ Delete unused RDS instances
NAT Gateways and Load Balancers are the most expensive forgotten resources. Always delete these first.
Protection 5 — Use AWS Trusted Advisor
AWS Console → Trusted Advisor → Cost Optimization
Trusted Advisor automatically scans your account and tells you:
- Idle EC2 instances
- Underutilized resources
- Cost saving opportunities
Free tier gives you basic checks. Worth checking monthly. ✅
My Complete AWS Cost Tracking Setup
After my 30 day forgotten instance experience I set up this system:
import boto3
from datetime import datetime, timedelta
def check_monthly_costs():
# Create Cost Explorer client
ce = boto3.client('ce', region_name='us-east-1')
# Get current month dates
today = datetime.now()
start_of_month = today.replace(day=1).strftime('%Y-%m-%d')
today_str = today.strftime('%Y-%m-%d')
# Get costs
response = ce.get_cost_and_usage(
TimePeriod={
'Start': start_of_month,
'End': today_str
},
Granularity='MONTHLY',
Metrics=['UnblendedCost'],
GroupBy=[
{
'Type': 'DIMENSION',
'Key': 'SERVICE'
}
]
)
print(f"AWS Costs from {start_of_month} to {today_str}:")
print("-" * 50)
total = 0
for result in response['ResultsByTime']:
for group in result['Groups']:
service = group['Keys'][0]
cost = float(group['Metrics']['UnblendedCost']['Amount'])
if cost > 0:
print(f"{service}: ${cost:.4f}")
total += cost
print("-" * 50)
print(f"Total this month: ${total:.4f} (₹{total*83:.2f})")
# Run weekly
check_monthly_costs()
Run this script every week. Takes 2 seconds. Shows exactly what you're spending and where. ✅
The Lesson That Changed How I Use AWS
Leaving my EC2 running for 30 days taught me something important.
Not about billing. Not about costs.
About attention.
Real production systems demand attention. They demand that you know what's running, what it costs, and why it exists.
The developers who get hired and trusted with real infrastructure are the ones who treat even their personal projects like production systems.
Monitor your costs. Clean up after yourself. Know what's running.
That mindset is worth more than any certification. 💪
Quick Reference — AWS Pricing for India (Mumbai ap-south-1)
| Resource | Cost | Free Tier |
|---|---|---|
| t2.micro | $0.0116/hour | 750 hours/month for 12 months |
| t2.small | $0.023/hour | None |
| t2.medium | $0.0464/hour | None |
| EBS gp2 | $0.114/GB/month | 30GB for 12 months |
| S3 Storage | $0.025/GB/month | 5GB for 12 months |
| Data Transfer Out | $0.109/GB | 1GB/month always free |
| Elastic IP (unattached) | $0.005/hour | Free when attached |
| NAT Gateway | $0.045/hour + data | None |
Save this table. Check it before launching any new resource. ✅
Final Thoughts
My 30 day forgotten EC2 instance cost me $0 thanks to free tier.
But it gave me something more valuable than money — it gave me the habit of thinking about costs, monitoring resources, and cleaning up after myself.
Those habits are exactly what separates a junior developer from someone who can be trusted with real infrastructure.
Set up your billing alerts today. Right now. Before you do anything else.
It takes 5 minutes and could save you thousands of rupees. 💪
Follow LearnWithPrashik for more honest AWS stories and practical cloud development content.
I share the real experiences — not just the highlight reel.
Connect with me:
LinkedIn: linkedin.com/in/prashik-besekar
GitHub: github.com/prashikBesekar
Top comments (0)