Set up CloudWatch alarms and SNS topic in AWS

Set up CloudWatch alarms and SNS topic in AWS

Let us know about AWS Cloudwatch and Amazon SNS services!!

What is Amazon CloudWatch?

Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the applications you run on AWS in real-time. You can use CloudWatch to collect and track metrics, which are variables you can measure for your resources and applications.

Read more about Cloudwatch from the official documentation here.

What is Amazon SNS?

Amazon Simple Notification Service is a notification service provided as part of Amazon Web Services since 2010. It provides a low-cost infrastructure for mass delivery of messages, predominantly to mobile users.

Read more about it here.

Task

  • Create a CloudWatch alarm that monitors your billing and sends an email to you when it reaches $2.

Step 1: Don't forget to enable billing alerts (if there is a new AWS account) before creating Cloudwatch Alarm.

To enable the monitoring of estimated charges:

  1. Open the AWS Billing console at https://console.aws.amazon.com/billing/.

  2. In the navigation pane, choose Billing Preferences.

  3. Choose Receive Billing Alerts.

  4. Choose Save preferences.

Step 2: Search Cloudwatch in the search box and come to this home page.

Step 3: Click on create alarm in all alarm from the left-side panel in the above step.

Select metric and we can see the Billing, click on it.

Select Total Estimated Charge.

Select USD and click on select metric.

Specify the metric and set USD threshold values as '2'. Click on next.

Step 4: Click on create new topic and mention the necessary details.

Go to AWS Simple Notification Service(SNS) via the SNS Console link. From there, we can view any pending subscriptions that require confirmation.

Create a subscription by selecting the pending confirmation.

Our Subscription will be created successfully.

Step 5: Come back to the Cloudwatch page where we left off & click on next.

Provide the alarm name and click on next.

Review the work and click on create alarm.

Step 6: Although the alarm has been created successfully, an additional step is required, which is "email confirmation". Therefore, please click on the "Confirm Subscription" link sent to the email address. Once confirmed, the page should appear like the following.

Finally, our Billing Alarm will look similar to this page.

  • Delete the billing Alarm that you created now.

Step 7: Delete the billing alarm which we created as shown below.

That's all Guys, we have learnt today how to create billing alarm via Amazon Cloudwatch and how to setup the notification through an email via Amazon SNS service.

Need help with Cloudwatch? Check out this official documentation for assistance.

Keep growing your AWS knowledge💥🙌

Happy Learning.


Thanks for reading the articles.

Keep husting and keep positive essence to grow.

Stay tuned for the next amazing blog.

Peace out!!