๐งช Lab 5: Cloud Monitoring & Incident Response (AWS)
Course: CompTIA Cloud+ CV0-004
Objective: Set up cloud monitoring, create alarms, and simulate a basic incident response process using AWS CloudWatch.
๐ฏ Goals
- Enable detailed monitoring on EC2
- Create CloudWatch alarms
- Simulate high CPU usage
- Automate notification with SNS
๐ Part 1: Enable Monitoring on EC2
- Go to EC2 Dashboard
- Select your instance (
cloudplus-ec2)
- Under Monitoring tab, click Enable Detailed Monitoring
โ
Checkpoint: Instance now sends 1-minute metrics to CloudWatch.
๐ Part 2: Create CloudWatch Alarm
- Go to CloudWatch โ Alarms โ Create alarm
- Choose EC2 โ
cloudplus-ec2 โ Metric: CPUUtilization
- Conditions:
-
Threshold: CPUUtilization > 70% for 2 datapoints within 5 minutes
-
Notification:
- Create new SNS topic โ
cloud-alerts
- Email subscription: your email address
- Confirm the subscription from your inbox
โ
Checkpoint: Alarm and notification system are ready.
๐ฅ Part 3: Simulate High CPU Usage
- SSH into your EC2 instance:
ssh -i "cloudplus-key.pem" ec2-user@<your-public-ip>
- Install stress tool:
sudo amazon-linux-extras install epel -y
sudo yum install -y stress
- Run stress test:
stress --cpu 2 --timeout 300
โ
Checkpoint: Alarm should trigger within 5 minutes and send an email.
๐ ๏ธ Part 4: Review Alarm and Take Action
- Go back to CloudWatch โ Alarms
- View status change and notifications
- Take manual action (e.g., reboot instance or notify team)
โ
Checkpoint: Youโve simulated an incident and verified your alert workflow.
โ
Lab Complete