Day 46: Set-up CloudWatch Alarms and SNS Topics in AWS

Day 46: Set-up CloudWatch Alarms and SNS Topics in AWS

ยท

3 min read

You have been using AWS services at least for the last 45 days. Have you ever wondered what happens if any service is charging your bill continuously and you don't know till you lose all your pocket money?

Well! We, as a responsible community, always try to make it under the free tier, but it's good to know and set up something, which will inform you whenever a bill touches a Threshold.

What is Amazon CloudWatch?

Amazon CloudWatch is a monitoring and observability service provided by Amazon Web Services (AWS) that allows you to collect and track metrics, collect and monitor log files, and set alarms. It helps you gain system-wide visibility into resource utilization, application performance, and operational health.

Key Features of CloudWatch

  • CloudWatch provides a wide range of metrics for AWS resources, including EC2 instances, RDS databases, and more.

  • CloudWatch Logs allows you to collect and store log files from various AWS resources.

  • CloudWatch Alarms enable you to monitor metrics and send notifications or take automated actions based on predefined thresholds or anomalies.

  • CloudWatch Events allow you to respond to changes in your AWS resources.

  • CloudWatch Synthetics helps you proactively monitor your application endpoints.

What is Amazon SNS?

Amazon Simple Notification Service (SNS) is a fully managed messaging service provided by Amazon Web Services (AWS). It allows you to build distributed, decoupled, and highly available applications. SNS simplifies the process of creating a communication layer for your applications, which enables them to send notifications, alerts, or messages to a large number of subscribers or other distributed components.

Key Features of Amazon SNS

  • SNS follows the publish-subscribe model, where one component, the publisher, sends messages to a specific topic.

  • SNS can deliver messages to multiple subscribers at once.

  • You can implement message filtering based on attributes or conditions to ensure that subscribers receive only the messages they are interested in.

  • SNS ensures high availability and fault tolerance. Messages are stored redundantly across multiple Availability Zones to prevent data loss.

  • SNS integrates with AWS CloudWatch, allowing you to monitor the health and performance of your topics.

TASK

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

Delete your billing Alarm that you created now.

Follow the steps given below to complete the task:

  • In the AWS Management Console, navigate to the Billing & Cost Management section.

  • In the left navigation pane, choose Budgets.

  • Choose Create a budget.

  • Under Settings, provide a Name for your budget (e.g., "Billing Alarm").

  • Under Budget type, select "Cost budget."

  • For Period, choose "Monthly."

  • In the Budgeted amount field, enter the amount you want to set as your budget (in this case, $2).

  • Under Additional notifications, you can add email addresses to notify when the budget threshold is reached.

  • Click on the Create button.

Now, you have created a budget that monitors your billing costs. When your monthly AWS costs reach or exceed $2, you will receive an email notification. If you want to delete this budget in the future, you can do so by navigating to the Budgets section and selecting the budget you want to delete, then choosing Delete.


That's all for today. Hope you like it. FOLLOW to join me in the journey of DevOps

ย