Monitor EC2 CPU Usage with AWS CloudWatch and Get Email Alerts via SNS

asha khatiasha khati
3 min read

#aws #cloudwatch

Introduction

Monitoring your infrastructure is critical — especially when something goes wrong! One of the easiest ways to start with AWS monitoring is using CloudWatch Alarms with Amazon SNS (Simple Notification Service) to send alert emails.

In this blog, I’ll walk you through how I set up a CloudWatch Alarm to monitor an EC2 instance’s CPU usage and get instant email notifications when usage crosses a threshold. This was part of my AWS hands-on practice and a great beginner-friendly project to understand real-world cloud monitoring.


🧰 Prerequisites

  • An AWS account

  • An EC2 instance running (can be t2.micro)

  • IAM permissions to use CloudWatch and SNS

  • A valid email address to receive alerts


🪜 Step-by-Step Guide

✅ Step 1: Create an SNS Topic

  1. Go to the SNS service from the AWS console.

  2. Click "Create topic" → Select Standard type.

  3. Name the topic: ec2CPUUtilisationAlarmTopic

  4. Leave other settings as default and click Create topic.


✅ Step 2: Subscribe to the SNS Topic

  1. After creating the topic, click on "Create subscription".

  2. Protocol: Email

  3. Endpoint: Enter your email address

  4. You will receive a confirmation email — click the link inside it to confirm.


✅ Step 3: Create a CloudWatch Alarm

  1. Go to CloudWatch → Alarms → Create Alarm

  2. Click "Select Metric" → Choose:

    • EC2 → Per-Instance Metrics → CPUUtilization
  3. Select your instance → click "Select metric"

  4. Set:

    • Threshold: Greater than 50%

    • Evaluation period: 5 minutes

  5. On next screen, choose:

    • Send a notification to → SNS topic → select ec2CPUUtilisationAlarmTopic
  6. Name your alarm: PRIO: cpu utilisation exceeded

  7. Review & Create.


✅ Step 4: Simulate or Wait for an Alert

I used python script to simulate the CPU utilization usage above 50%.

When the CPU usage crosses the threshold, you’ll get an email from AWS Notifications:

You’re now officially monitoring your EC2!


📸 Result Screenshot


🎯 What I Learned

  • How to connect AWS services (CloudWatch + SNS) for real-world automation

  • The basics of event-driven alerts

  • Confidence to explore Lambda actions or Slack integrations next

This simple setup can be a lifesaver in real infrastructure scenarios — and it’s 100% beginner-friendly.


🔁 Next Steps (What I’ll Try Next)

  • Integrating SNS with Lambda to auto-remediate issues

  • Pushing alerts to Slack or Teams

  • Monitoring memory or disk space using custom metrics


🏷️ Tags

#aws #cloudwatch #sns #devops #cloud #monitoring #womenintech


🙏 Thanks for Reading!

I’m currently expanding my cloud skills and sharing my learning through small, hands-on projects like this.


Would you like a follow-up blog template for:

  • Automating actions with Lambda

  • Setting up custom CloudWatch metrics

  • Creating a full CI/CD alert pipeline?

I’m happy to help you turn your next hands-on into a great article 💻✨

0
Subscribe to my newsletter

Read articles from asha khati directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

asha khati
asha khati