AWS cloudWatch: Monitoring Your Resources Made Easy

Published: (February 16, 2026 at 11:48 AM EST)
3 min read
Source: Dev.to

Source: Dev.to

Overview

Amazon CloudWatch acts as a watchdog for your AWS resources. It collects metrics such as CPU utilization, memory usage, and network traffic, displays them on dashboards, and can trigger notifications when thresholds are breached.

Launch an EC2 Instance

  1. Sign in to the AWS Management Console and search for EC2.

  2. Click Launch instance.

  3. Enter a name for the instance (e.g., BravoEC2).

  4. Scroll down to Key pair, give it a name, and click Create key pair.

  5. Click Launch instance to finish.

  6. After the instance is running, select it and click ConnectConnect to open an SSH session.

  7. Switch to the root user:

    sudo su -

View EC2 Metrics in CloudWatch

  1. In the console search bar, type CloudWatch and select it.
  2. Choose MetricsAll metricsEC2Per‑instance metrics.
  3. Check the box next to CPUUtilization to display the metric on the graph.

Create an SNS Topic and Subscription

  1. Search for SNS (Simple Notification Service) and open it.
  2. Click TopicsCreate topic.
  3. Choose Standard, give the topic a name (e.g., EC2-Alerts), and click Create topic.
  4. With the new topic selected, click Create subscription.
  5. Set Protocol to Email, enter your email address in Endpoint, and click Create subscription.
  6. Check your inbox for the confirmation email from AWS and click the confirmation link.

Create a CloudWatch Alarm

  1. Return to CloudWatch, then select AlarmsAll alarms.

  2. Click Create alarmSelect metric.

  3. Navigate to EC2Per‑instance metrics, check CPUUtilization, and click Select metric.

  4. Configure the alarm condition:

    • Threshold type: Static
    • Whenever CPUUtilization is ≥ 75% for 3 consecutive periods of 1 minute (total 3 minutes)
  5. Click Next and choose the SNS topic you created earlier.

  6. Click Next, give the alarm a name (e.g., High-CPU-Alarm), and click Create alarm.

Test the Alarm

  1. Install the stress tool on the instance (Amazon Linux example):

    sudo yum install -y stress
  2. Run a CPU stress test that exceeds the alarm threshold:

    stress --cpu 2 --timeout 300

    This command loads two CPU cores for 5 minutes, pushing CPU utilization above 75%.

  3. Verify that you receive an email notification indicating high CPU usage.


You have now set up CloudWatch monitoring, an SNS notification channel, and an alarm that alerts you when your EC2 instance experiences high CPU utilization.

0 views
Back to Blog

Related posts

Read more »

Getting Started with AWS EC2 Key Pairs

Introduction Hey there, cloud enthusiasts! If you're just starting your AWS journey like I am, you've probably heard the term “key pairs” thrown around and won...

Os 4 Sinais Dourados da Google

Introdução Neste artigo abordaremos um dos maiores marcos para consolidar o SRE: os 4 Sinais Dourados Golden Signals do Google. Eles são fruto da experiência d...