Set up CloudWatch alarms and SNS topic in AWS

Set up CloudWatch alarms and SNS topic in AWS

#90 DaysofDevOps Challenge - Day 45

What is Amazon CloudWatch?

Amazon CloudWatch is a monitoring and observability service provided by Amazon Web Services (AWS). It helps you collect and track various metrics, log files, and events from your AWS resources and applications. CloudWatch provides valuable insights into the performance, health, and operational state of your AWS infrastructure.

In simple terms, CloudWatch acts as a monitoring tool that allows you to keep an eye on your AWS resources and applications. It gathers data such as CPU usage, network traffic, and storage utilization from your resources. You can view this data in the form of graphs, charts, and alarms in the CloudWatch console.

With CloudWatch, you can set up alarms to notify you when specific conditions are met, such as high CPU usage or low storage space. These alarms can trigger actions or send notifications to help you quickly respond to any issues.

CloudWatch also collects logs from your applications, making it easier to troubleshoot and analyze any errors or issues in your system. You can search and filter logs based on keywords or specific criteria to identify and resolve problems.

What is Amazon SNS?

Amazon Simple Notification Service (SNS) is a fully managed messaging service provided by Amazon Web Services (AWS). It enables you to send and receive messages or notifications to and from various endpoints, such as mobile devices, email addresses, and other distributed systems.

In simple terms, SNS allows you to send messages to different types of recipients or subscribers. You can think of it as a communication hub that helps you distribute information to multiple destinations at once.

Task :

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

  • Delete the billing Alarm that you created now.

To create a CloudWatch alarm that monitors your billing and sends an email notification when it reaches $2, follow these steps:

  • First, go to Billing Dashboard -> Billing Preferences and activate both preferences

  • Go to the AWS Management Console and navigate to the CloudWatch service.

  • In the CloudWatch console, click on "Alarms" in the left navigation pane.

  • Click on the "Create alarm" button.

  • In the "Create Alarm" wizard, under the "Select metrics" section, choose "Billing" as the namespace.

  • Select the "EstimatedCharges" metric.

  • Configure the conditions for the alarm:

    • For the first condition, select the "Greater than" operator.

    • Enter the value "$2" in the threshold field.

  • Configure the email notification settings, including the email address where you want to receive the notifications.

  • Provide a name and description for the alarm.

  • Click on the "Create alarm" button to create the CloudWatch alarm.

Now, CloudWatch will monitor your billing and send an email notification when it exceeds $2.

To delete the billing alarm you created, follow these steps:

  1. Go to the CloudWatch console and navigate to the "Alarms" section.

  2. Locate the billing alarm you want to delete from the list.

  3. Select the checkbox next to the alarm.

  4. Click on the "Actions" dropdown menu and choose "Delete".

  • Confirm the deletion when prompted.


Thank you for reading. I hope you were able to understand and learn something new from my blog.

Happy Learning!

Please follow me on Hashnode and do connect with me on LinkedIn ArnavSingh.

Did you find this article valuable?

Support Arnav Singh by becoming a sponsor. Any amount is appreciated!