Lab Information
The Nautilus DevOps team has been tasked with setting up an EC2 instance for their application. To ensure the application performs optimally, they also need to create a CloudWatch alarm to monitor the instance's CPU utilization. The alarm should trigger if the CPU utilization exceeds 90% for one consecutive 5-minute period. To send notifications, use the SNS topic named datacenter-sns-topic which is already created.
Launch EC2 Instance: Create an EC2 instance named datacenter-ec2 using any appropriate Ubuntu AMI.
Create CloudWatch Alarm: Create a CloudWatch alarm named datacenter-alarm with the following specifications:
Statistic: Average
Metric: CPU Utilization
Threshold: >= 90% for 1 consecutive 5-minute period.
Alarm Actions: Send a notification to datacenter-sns-topic.
Lab Solutions
πΉ STEP 1: Launch the EC2 Instance
1οΈβ£ Open EC2
AWS Console β EC2 β Launch instance
2οΈβ£ Configure instance
Name: datacenter-ec2
AMI: Ubuntu Server (20.04 LTS or 22.04 LTS)
Instance type: t2.micro (or any allowed type)
Key pair: Select or create one (lab choice)
Network:
Default VPC
Default subnet
Security group:
Allow SSH (port 22)
3οΈβ£ Launch
Click Launch instance
Wait until:
State: Running
Status checks: 2/2 passed
πΉ STEP 2: Create the CloudWatch Alarm
1οΈβ£ Open CloudWatch
AWS Console β CloudWatch
Left menu β Alarms
Click Create alarm
2οΈβ£ Select the Metric
Click Select metric
Navigate:
EC2 β Per-Instance Metrics β CPUUtilization
Select the metric for datacenter-ec2
Click Select metric
3οΈβ£ Configure Alarm Conditions
Set the following exactly:
Setting Value
Statistic Average
Period 5 minutes
Threshold type Static
Condition Greater than or equal to
Threshold value 90
Datapoints to alarm 1 out of 1
4οΈβ£ Configure Alarm Actions
Alarm state trigger: In alarm
Send notification to:
Select Existing SNS topic
Choose datacenter-sns-topic
5οΈβ£ Name the Alarm
Alarm name: datacenter-alarm
Description (optional):
Alarm when CPU exceeds 90% for 5 minutes
Click Create alarm
πΉ STEP 3: Verify Configuration
β CloudWatch Alarm
State initially: OK (normal)
Metric: CPUUtilization
Threshold: β₯ 90%
Period: 5 minutes
β SNS Action
Alarm action shows datacenter-sns-topic

Top comments (0)