How to create a Billing Alarm to Monitor Your Estimated AWS Charges using Amazon CloudWatch?

You must have noticed that while using the services of AWS you are charged with a certain amount according to the type of services you choose. Here, you can first use the AWS Simple Monthly Calculator to estimate the cost of various AWS services you use. If you require further guidelines on using the AWS Simple Monthly Calculator, you can visit the link provided below to know about the usage and implementation of AWS Simple Monthly Calculator.

Now, you must be wondering, What if the amount you estimated is not approximately correct? So in such condition, you must be thinking that it would have been so good if you got some type of notification message when the amount charged for the usage of services exceeds the amount that you had initially estimated. Well, your wish gets granted by the Billing Alarm which lets you obtain the notification about the amount charged for using various AWS services you use.

In this blog, I will be discussing on the stepwise procedure to set up your Billing Alarm for estimating your AWS charges using Amazon CloudWatch.

Procedure for creating a Billing Alarm using Amazon CloudWatch

Step 1: Go to your AWS Management Console.

Image for post
Image for post

Step 2: Now, go to your account and click on “My Billing Dashboard”.

Image for post
Image for post

Step 3: On your left-hand side now you can see the option of “Billing preferences”. Click on “Billing preferences”.

Image for post
Image for post

Step 4: Here in “Billing preferences”, select “Receive Billing Alerts” and click on “Save preferences” button.

Image for post
Image for post

Step 5: Now, open “Manage Billing Alerts” in the new tab. “Manage Billing Alerts” redirects you to Amazon CloudWatch where we will be setting up our billing alerts.

Image for post
Image for post

Step 6: Here, on the left-hand side go to the “Billing” section.

Image for post
Image for post

Step 7: Under the “Billing”, click on “Create alarm” button.

Image for post
Image for post

Step 8: Now, you need to “Specify metric and conditions” in which the alarm gets triggered. Here, in Metric, namespace is given as “AWS/Billing”, provide “Metric name” as your choice, give the desired “Currency” for instance USD for US Dollars, then in “Statistic” select “Maximum” and finally select the “Period” in which alarm should be generated.

Image for post
Image for post

Step 9: Now, moving on to “Conditions”, we need to specify “Threshold type” as “Static” and give a condition as “Whenever EstimatedCharges is..” where you define the alarm condition. For instance, we will be selecting “Greater/Equal” as we want to get a billing alarm when the estimated charge gets greater than/ equals to the specified amount. After then, now you are required to specify “than…” where you define the threshold value after which you want the alarm to get triggered. For example, we are providing an amount of 5 USD. Besides them, we also need to make some additional configuration, i.e. “Datapoints to alarm” which has been provided as “1 out of 1” and “Missing data treatment” as “Treat missing data as missing”.

Image for post
Image for post

Step 10: After specifying the metric and conditions, click on the “Next” button.

Image for post
Image for post

Step 11: Now in the section of Configure Actions, the “Alarm state trigger” comprises three states. “In alarm” is the state when the metric has crossed the specified Threshold. Similarly, the “OK” state, means all is well, and “Insufficient data” means that the alarm has just started because of which there is no enough data available to report an alarm state.

Image for post
Image for post

Step 12: After providing “Alarm state trigger”, we are required to “Select and SNS topic” to define Simple Notification Service which is a notification process to set the alarm. Here, you can select “Create new topic” option.

Image for post
Image for post

Step 13: Now, in Select an SNS topic, select “Create a new topic”. Here, you are required to provide a unique topic name. Then, provide your email address in the section named “Email endpoints that will receive the notification…”

Image for post
Image for post

Step 14: Here, click on “Next” button.

Image for post
Image for post

Step 15: In the section “Add name and description”, you are required to specify a unique name for “Alarm name”. Also, you can mention “Alarm description” which is not mandatory. Then finally, you can click on the “Next” button.

Image for post
Image for post

Step 16: Here, you are required to “Preview and create” the Billing Alarm. Once you have verified the setup process, you can now click on “Create alarm”.

Image for post
Image for post

Step 17: Since a message is being displayed on the top as “Some subscriptions are pending confirmation”, click on “View SNS Subscriptions” as shown in the image below.

Image for post
Image for post

Step 18: After you get redirected to Amazon SNS, you can see that the confirmation is pending. So, go to your Gmail account to confirm your subscription.

Image for post
Image for post

Step 19: In your Gmail, click on “Confirm subscription” as shown below.

Image for post
Image for post

Step 20: Now, a message “your subscription has been confirmed” will show up. After then, you can go back to Amazon SNS.

Image for post
Image for post

Step 21: Here, in the Alarms section in CloudWatch, you can view that the status is in the “OK” state.

Image for post
Image for post

Step 22: On the left, click on “Billing” option as shown in the image. Here too, you can see that the status of “FirstBillingAlarm” is in the “OK” state.

Image for post
Image for post

Written by

Cloud Computing | Data Science | Mobile Application Development | Artificial Intelligence | Python Programming | Soft Skills | Many more…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store