# Day 46: Set up CloudWatch Alarms and SNS Topic in AWS

Today, we will dive into the world of CloudWatch alarms and SNS topics, two powerful tools for monitoring and alerting in the AWS ecosystem. Let's get started!

**Task 1: Create a CloudWatch Alarm for Billing Monitoring**

In this task, we will create a CloudWatch alarm to monitor our billing and receive an email notification when it reaches a threshold of $2.

**Enabling billing alerts**

1. Open the AWS Billing console at [https://console.aws.amazon.com/billing/](https://console.aws.amazon.com/billing/).  
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686786501461/580836cc-ebd9-48b4-8017-886a1d39e089.png align="center")
    
2. In the navigation pane, choose **Billing Preferences(Left Side)**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686786517736/f1079df1-aa04-4f20-a428-a174f6e4823f.png align="center")
    
3. By **Alert preferences** choose **Edit**.  
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686786547780/759c8f90-d580-4957-ae58-e1e6bb1a3974.png align="center")
    
4. Choose **Receive CloudWatch Billing Alerts**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686786568672/d32efd5f-e7d1-4155-8382-da2a1717bac6.png align="center")
    
5. Choose **Save preferences**.
    

To set up the alarm, follow these steps:

1. Log in to the AWS Management Console and navigate to the CloudWatch service.  
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686785321765/49beb4db-4ff6-4b46-b096-e178fde005cd.png align="center")
    
2. Click on "Alarms" in the left-hand menu and then "Create Alarm".  
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686785387431/1a5c3f41-3db6-4e66-9ed1-289e359705dd.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686785398064/143a98f4-556c-4f14-b6a1-868a8d41d8ea.png align="center")
    
3. Choose "Billing" as the metric namespace and select the "EstimatedCharges" metric.  
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686786748308/c150d747-0898-4508-924f-6a7e221fb24b.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686786760453/41a756a0-998d-497a-a5b0-7bde27952c77.png align="center")
    
    click on add to graph then select matric
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686786771814/1e068456-22cc-489b-b973-64438dbabbd7.png align="center")
    
4. Set the conditions for the alarm, such as the threshold of $2 for the billing amount.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686786916693/6990745b-8c34-4ea2-9429-8b6a8dbe5787.png align="center")
    
5. Configure the actions to be taken when the alarm state is triggered, such as sending an email notification.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686787024055/69d84133-d441-43ab-a0d3-919f034fc1eb.png align="center")
    
6. Review the alarm settings and create the CloudWatch alarm.
    

**Task 2: Delete the Billing Alarm**

Once you no longer need the billing alarm, it's important to remove it from your CloudWatch configuration. Here's how you can delete the billing alarm:

1. Go to the CloudWatch service in the AWS Management Console.
    
2. Click on "Alarms" in the left-hand menu and find the billing alarm you created in Task 1.  
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686787158784/e5bba459-d443-4c15-b104-9a54bcbc8891.png align="center")
    
3. Select the alarm and click on the "Actions" button.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686787195603/adf9d241-4baf-4cd6-b062-bf39c590be22.png align="center")
    
4. Choose "Delete" from the dropdown menu and confirm the deletion when prompted.
    

By deleting unnecessary alarms, you can keep your CloudWatch environment organized and focused on the critical metrics that matter to your applications and services.

That's it for today. If you have any queries/suggestions please write in comment. See you another day with another challenge.
