Set up CloudWatch alarms and SNS in AWS

What is Amazon CloudWatch?

Amazon CloudWatch collects and visualizes real-time logs, metrics, and event data in automated dashboards to streamline your infrastructure and application maintenance.

What is Amazon SNS?

Amazon Web Services has included a notification service called Amazon Simple Notification Service. It offers a cheap infrastructure for the widespread distribution of communications, mostly to mobile users.

Task :

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

To enable the monitoring of estimated charges

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

  2. Choose Billing Preferences from the navigation bar.

  3. Decide on Billing Notifications Received.

  4. choose Preferences to save.

No alt text provided for this image

No alt text provided for this image

Creating a billing alarm

  • Launch the CloudWatch interface.

  • Choose Alarms from the navigation pane, then select All alarms.

  • Choose Set alarm.

No alt text provided for this image

Select metric.

No alt text provided for this image

Choose Billing in Browse, then select Total Estimated Charge.

No alt text provided for this image

No alt text provided for this image

Choose metric after selecting the Estimated Charges metric checkbox.

No alt text provided for this image

Choose maximum under statistic.

select a period of 6 hours

No alt text provided for this image

Choose Static as the threshold type.

Choose Greater for Whenever EstimatedCharges is.

Choose a threshold value at which your alarm will go off. Here, the threshold amount is $2.

No alt text provided for this image

To get notifications while your alarm is in the ALARM state, enter an Amazon SNS subject under Notification.

By choosing "Create a new topic," you can either choose an already-existing Amazon SNS topic or start a brand-new one.

No alt text provided for this image

Choose Add notification if you want your alarm to deliver different alerts for the same alarm condition or for several alarm states.

select Next.

Give your alarm a name under "Name and description."

No alt text provided for this image

Make sure your configuration is right under Preview and create before selecting Create an alarm.

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

An alarm is set for billing.

No alt text provided for this image

No alt text provided for this image

Delete the billing alarm you just made.

No alt text provided for this image

I appreciate you continuing to read.