AWS Day 25: Monitoring EC2 CPU Utilization with CloudWatch Alarms | Kodekloud Challenge

"I'm a 3rd-year Computer Engineering student at Marwadi University with skills in C++, web development (MERN stack), and DevOps tools like Kubernetes. I contribute to open-source projects and share tech knowledge on GitHub and LinkedIn. I'm learning cloud technologies and app deployment. As an Internshala Student Partner, I help others find jobs and courses." now currently focusing on #90DaysOfDevops
Introduction
During Day 25 of the KodeKloud 100 Days of Cloud Challenge, I worked with two essential AWS services: Amazon EC2 and Amazon CloudWatch.
Launching an EC2 instance is usually the easy part. The real challenge begins when you need to monitor the health and performance of your infrastructure. In production environments, high CPU usage can impact application performance and user experience. This is where CloudWatch Alarms become useful.
In this lab, I launched an EC2 instance and configured a CloudWatch Alarm to notify the team whenever CPU utilization exceeded 90%.
Why CloudWatch Alarms Matter
Amazon CloudWatch continuously monitors AWS resources and allows us to create alarms based on specific metrics.
Some common use cases include:
High CPU utilization alerts
Low disk space notifications
Memory monitoring
Application health monitoring
Automated scaling decisions
For this task, the alarm was configured to monitor CPU Utilization on an EC2 instance.
Task Requirements
The following resources needed to be configured:
Create an EC2 instance named devops-ec2
Use an Ubuntu AMI
Create a CloudWatch Alarm named devops-alarm
Monitor CPU Utilization
Trigger the alarm when CPU usage is greater than or equal to 90%
Evaluation period: 1 consecutive period of 5 minutes
Send notifications through the SNS topic devops-sns-topic
Step 1: Launch an EC2 Instance
I started by navigating to the EC2 Dashboard and selecting Launch Instance.
For the instance configuration:
| Setting | Value |
|---|---|
| Name | devops-ec2 |
| AMI | Ubuntu |
| Instance Type | t2.micro (default) |
After reviewing the configuration, I launched the instance successfully.
Step 2: Verify the EC2 Instance
Once the instance was launched, I confirmed that its status changed to:
Running
This verified that the EC2 instance was available for monitoring.
Step 3: Navigate to CloudWatch
Next, I opened the CloudWatch Console and selected:
CloudWatch → Alarms
Then clicked:
Create Alarm
Step 4: Select the CPU Utilization Metric
To monitor CPU usage, I selected:
EC2 → Per-Instance Metrics → CPUUtilization
Then I chose the metric associated with the devops-ec2 instance.
Step 5: Configure the Alarm Threshold
The alarm was configured using the following settings:
Setting | Value |
Metric | CPU Utilization |
Statistic | Average |
Threshold Type | Static |
Condition | Greater than or equal to |
Threshold Value | 90 |
Evaluation Period | 1 |
Period | 5 Minutes |
This configuration ensures that the alarm triggers if CPU utilization remains above 90% for one consecutive 5-minute period.
Step 6: Configure SNS Notifications
For notifications, I selected the existing SNS topic:
devops-sns-topic
This allows CloudWatch to send alerts whenever the alarm enters the ALARM state.
Step 7: Create the CloudWatch Alarm
Finally, I provided the alarm name:
devops-alarm
After reviewing the configuration, I created the alarm successfully.
Verifying the Configuration
After the alarm was created, it appeared in the CloudWatch Alarms dashboard.
The alarm state initially showed:
OK
This indicated that CPU utilization was below the configured threshold and monitoring was working correctly.
What I Learned
This challenge helped me understand that monitoring is just as important as deploying infrastructure.
Creating an EC2 instance only provides compute resources. To maintain reliability and performance, we also need visibility into system metrics. CloudWatch Alarms make it possible to proactively detect issues before they impact applications.
I also learned how SNS integrates with CloudWatch to deliver notifications automatically whenever a threshold is breached.
Conclusion
Day 25 introduced a practical monitoring use case using Amazon EC2, Amazon CloudWatch, and Amazon SNS.
By creating a CPU Utilization alarm, I gained hands-on experience with AWS monitoring and alerting. These services play an important role in production environments where quick detection and response to performance issues are critical for maintaining application availability.




