DEV Community

Cover image for Set Up AWS Budgets and Billing Alarms: Never Get a Surprise AWS Bill
Vishal Patil
Vishal Patil

Posted on

Set Up AWS Budgets and Billing Alarms: Never Get a Surprise AWS Bill

A beginner-friendly guide to AWS Budgets, CloudWatch billing alarms and Free Tier alerts, so you never get a surprise AWS bill.


Almost every AWS beginner has the same fear: leaving something running and getting a bill at the end of the month that they didn't expect. The good news is that AWS gives you free tools to catch this early.

In this article, you'll set up two safety nets in about 15 minutes: an AWS Budget and a CloudWatch billing alarm, plus Free Tier usage alerts.

Why you need alerts from day one

  • A forgotten EC2 instance, NAT Gateway, load balancer or Elastic IP keeps costing money while you're not using it.
  • Practice projects are easy to forget after the tutorial ends.
  • Alerts tell you early, when the amount is still small and easy to fix.

AWS Budgets vs CloudWatch billing alarms

AWS Budgets CloudWatch billing alarm
What it tracks Cost or usage against a limit you set, including forecasted spend Total estimated charges so far this month
Where you set it Billing and Cost Management console CloudWatch console, in us-east-1
Notification Email or SNS at thresholds you choose SNS topic (email, SMS, Lambda and more)
Cost Monitoring and notifications are free Standard CloudWatch alarm pricing
Best for Planning: "tell me before I exceed my limit" A simple tripwire: "tell me if charges pass $X"

Use both. They are cheap, quick to set up, and cover each other's gaps.

What you need

  • An AWS account and access to the root user, or an IAM user with billing permissions
  • A working email address

Note for IAM users: By default only the root user can see billing pages. The root user must turn on IAM user and role access to Billing information in Account settings.

Part 1: Turn on billing alerts

  1. Open Billing and Cost Management in the console.
  2. Go to Billing preferences.
  3. Under Alert preferences, enable AWS Free Tier alerts and add your email.
  4. Enable CloudWatch billing alerts (needed for Part 3) and save.

Menu labels change from time to time, so if something looks slightly different, search for "Billing preferences" in the Billing console.

Part 2: Create a monthly cost budget

  1. Open Budgets and choose Create budget.
  2. Pick the Monthly cost budget template. (The Zero spend budget alerts you as soon as spending goes above the Free Tier.)
  3. Name it (for example monthly-cost-budget) and set an amount such as $5 or $10 for a learning account.
  4. Enter the email address(es) for alerts.
  5. Choose **Create budget.

Then add thresholds:

Alert Threshold Why
Actual cost 50% of budget Early heads-up that you're spending faster than planned
Actual cost 80% of budget Time to review what's running
Forecasted cost 100% of budget Warns you before you cross the limit

Good to know : AWS updates budget data a few times a day, so alerts aren't instant. Monitoring and notifications are free. Only optional extras cost money: after your first two action-enabled budgets each month, extra ones cost $0.10 per day, and each emailed Budgets report costs $0.01.

Part 3: Create a CloudWatch billing alarm

Billing metrics are only published in US East (N. Virginia) us-east-1, so switch to that Region first, even if your resources are elsewhere.

  1. Open CloudWatch and switch the Region to US East (N. Virginia).
  2. Go to Alarms → All alarms → Create alarm → Select metric.
  3. Choose Billing → Total Estimated Charge**, select the USD metric (EstimatedCharges).
  4. Set Statistic = Maximum,Period = 6 hours, Static, Greater than your limit (for example 5).
  5. Create a new SNS topic (for example billing-alerts) and enter your email.
  6. Name the alarm (for example Billing-Alarm-5-USD) and create it.
  7. Open your inbox and confirm the SNS subscription email. Until you do, no alerts will reach you.

Prefer the CLI? Use this (replace the SNS topic ARN with yours):

aws cloudwatch put-metric-alarm \
  --alarm-name "Billing-Alarm-5-USD" \
  --namespace "AWS/Billing" \
  --metric-name "EstimatedCharges" \
  --dimensions Name=Currency,Value=USD \
  --statistic Maximum \
  --period 21600 \
  --evaluation-periods 1 \
  --threshold 5 \
  --comparison-operator GreaterThanThreshold \
  --alarm-actions arn:aws:sns:us-east-1:<account-id>:billing-alerts \
  --region us-east-1
Enter fullscreen mode Exit fullscreen mode

Part 4: Verify everything works

Check What to look for
Budgets console Your budget is listed with status "OK"
CloudWatch (us-east-1) The alarm shows "OK" (or "Insufficient data" briefly)
SNS The subscription status is Confirmed, not "Pending"
Email You received the Free Tier alert and SNS confirmation messages

Common mistakes

Problem Fix
No billing metric in CloudWatch Switch to us-east-1 and enable CloudWatch billing alerts
Alarm never sends email Confirm the SNS subscription email and check spam
Can't open billing pages as an IAM user Root user must activate IAM access to Billing information
Alert arrived but charges are unclear Use **Cost Explorer and group by Service

Best practices

  • Alerts are notifications, not a spending cap. AWS won't stop your resources automatically, so act when you get the email.
  • Use several thresholds (50%, 80%, forecasted 100%).
  • Check Cost Explorer once a week while you're learning.
  • Tag lab resources (for example Project=learning) so they're easy to find and delete.
  • Delete resources after every lab: EC2, NAT Gateways, load balancers, unused Elastic IPs and old EBS volumes.
  • Protect the root user with MFA.
  • Next step: explore AWS Budgets Actions and Cost Anomaly Detection.

Conclusion

Setting up AWS Budgets and billing alarms takes only a few minutes, costs nothing for the basic setup, and protects you from the most common beginner mistake in the cloud. Do it once, right after you create your account, and you can experiment with AWS services with much more confidence.

If this helped you, let me know which AWS topic you'd like me to cover next.


Author : Vishal Patil

🔗 LinkedIn: https://www.linkedin.com/in/vishalpatil-devops-aws/
💻 GitHub: https://github.com/VishalPatil-DevOps-AWS

vishalcloudjourney #AWS #AWSBudgets #CloudWatch #CostOptimization #FinOps #DevOps

Top comments (0)