In this example, I’m going to set up a billing alarm that will send an email whenever my AWS billing goes above $10 USD.
This is a 2 step process whereby we first create an e-mail notification with the Simple Notification Service (SNS) followed by creating our billing alarm within CloudWatch.
Setup SNS E-Mail Notification
Once you have signed in to your AWS console, click on services, and in the search files, type in sns. Click on Simple Notification Service.
Next, click on ‘Topics’ within the left-hand side menu.
Give your topic a name and display name. In my case, I used ‘Billing-Alarm-10-USD’ for the Name and ‘Billing Alarm 10 USD’ for the Display name. Click ‘Create topic’ at the bottom of the page.
You will now see that your AWS billing alarm topic has been created successfully. Displayed are some details. If you already have a lot of topics setup, you will want to take note of the ARN value, as we will be using this in the next step.
Within the same window as the screenshot above, click on the orange button entitled ‘Create Subscription’. Enter in the word ‘Billing’ within the Topic ARN field, the ARN value for your topic will automatically pop up. Select your Billing topic.
Under Protocol, select Email and within the Endpoint field, type in the email address where you will receive the Billing alarm whenever costs reach above $10 USD. Click on ‘Create Subscription’ below.
Your email subscription is now setup, and you can see within the Details window that it is a member of the Topic we created earlier called ‘Billing-Alarm-10-USD’
Shortly you will receive an email asking you to confirm your email. Simply click on the link provided which will confirm your subscription. Click ‘Topics’ within the left-hand side menu. You will see that your subscribed email address is now confirmed.
If you make a mistake on the email address or don’t click on the link in the confirmation email, AWS will remove the subscription within 3 days. You cannot manually delete it. However, you can manually delete a confirmed subscriber.
Now it’s time to head on over to CloudWatch. Click on Services at the top of the page and within the search field type in ‘cloudwatch’. Click on CloudWatch once it automatically pops up.
Setup CloudWatch Billing Alarm
Once you’re in CloudWatch, click on ‘Alarms’ on the left hand side.
Click the orange button, ‘Create alarm’ at the top right-hand side.
Use the following settings for the metric section:
- Metric Name: EstimatedCharges
- Currency: USD (Change for your preference)
- Statistic: Maximum
- Period: 6 hours
Use the following settings for the Conditions:
- Threshold type: Static
- Whenever EstimatedCharges is..: Greater/Equal
- than…: 10 (Optionally change this to the threshold you want)
For step 2, we configure the action. Use the following settings:
- Whenever this alarm state is…: in Alarm
- Select an SNS topic: Select an existing SNS topic
- Send a notification to…: Billing-Alarm-10-USD
We now define an Alarm name for our alarm, along with an optional description. My Alarm name will be ‘Billing-Over-10-USD’ and for the description, I will use ‘AWS Billing is greater than $10 USD’
You are now presented with a summary of the settings you have used to create your Billing Alarm. If you need to change anything you can click on the Edit button for that section or click on the previous button. If you are happy with all your settings click ‘Create Alarm’
Your Billing Alarm has now been created and is gathering data.
After a few hours, when your Billing Alarm has collected enough data, it will change status from INSUFFICIENT to OK, as you can see in the screenshot below.
Enable Free Tier Usage Alarms
The next alarm we are going to configure is useful if you are using the AWS free tier. Enabling this option will notify you via email when you are close to reaching your monthly free tier limit or if it has been exceeded.
Click on Services at the top right of the screen and search for Billing. Click on the Billing service. Within the Billing service, click on ‘Billing preferences’ under the Preferences section on the right-hand side.
Tick the box next to ‘Receive Free Tier Usage Alerts’ and enter an email address where you wish to receive the alerts. Once you are done click the ‘Save preferences’ button.