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.
Using AWS Simple Monthly Calculator to calculate the price of an AWS Service
If you have been using AWS to host your website, you might have faced some difficulties while calculating and…
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.
Step 2: Now, go to your account and click on “My Billing Dashboard”.
Step 3: On your left-hand side now you can see the option of “Billing preferences”. Click on “Billing preferences”.
Step 4: Here in “Billing preferences”, select “Receive Billing Alerts” and click on “Save preferences” button.
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.
Step 6: Here, on the left-hand side go to the “Billing” section.
Step 7: Under the “Billing”, click on “Create alarm” button.
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.
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”.
Step 10: After specifying the metric and conditions, click on the “Next” button.
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.
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.
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…”
Step 14: Here, click on “Next” button.
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.
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”.
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.
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.
Step 19: In your Gmail, click on “Confirm subscription” as shown below.
Step 20: Now, a message “your subscription has been confirmed” will show up. After then, you can go back to Amazon SNS.
Step 21: Here, in the Alarms section in CloudWatch, you can view that the status is in the “OK” state.
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.