So you received your bill from AWS but something is off — it is more expensive than you expected and that leaves you perplexed. After searching your management console you figure out some services utilized more resources than you wanted. What do you do? How do you prevent unnecessary billing?
The solution is to set up a billing alarm.
To set up a billing alarm for your AWS account, you will need to use Amazon CloudWatch.
CloudWatch is a monitoring and observability service that allows you to monitor your AWS resources and applications, and to create alarms that will notify you when certain conditions are met.
Before we start:
- Make sure that you have enabled billing alerts in the AWS Billing and Cost Management console. To do this, go to the Billing and Cost Management console, select Preferences, and then select Receive CloudWatch Billing Alerts. After you enable billing alerts for the first time, it takes about 15 minutes before you can view billing data and set billing alarms.
- Create an Amazon Simple Notification Service (SNS) topic to receive your billing alerts.
To set up a billing alarm:
- Open the CloudWatch console (here)
- In the navigation pane, choose Alarms, and then choose Create Alarm.
- Choose Select metric.
- In the Browse section, choose Billing, and then choose Total Estimated Charge.
- Choose Select metric.
- Under Conditions, define the threshold that you want to monitor. For example, you might want to set an alarm to trigger if your estimated charges exceed $10 per day.
- Under Actions, choose the actions that you want CloudWatch to take when the alarm is triggered. For example, you might want CloudWatch to send you an email or SMS message.
- Choose Next.
- Review your alarm settings and choose Create Alarm.
Once you have created your billing alarm, CloudWatch will start monitoring your estimated charges. If your estimated charges exceed the threshold that you have defined, CloudWatch will trigger the alarm and perform the actions that you have specified.
Stay Clouding!