Lab Overview
Amazon CloudWatch is AWS's unified observability service. Build a dashboard, create metric alarms with SNS email notifications, explore log groups from Lambda, and set up a billing alarm.
| Service | Purpose | Free Tier |
|---|---|---|
| Amazon CloudWatch | Dashboards, metrics, alarms, and log management | 10 custom metrics + 10 alarms free |
| Amazon SNS | Sends email/SMS when alarms trigger | 1M notifications/mo free |
| AWS Billing | Cost and usage metrics for billing alarms | Always free |
Step-by-Step Instructions
1
Amazon CloudWatch
Create a Dashboard
- Search for CloudWatch and click it
- Left sidebar: Dashboards → Create dashboard
- Name: MyLabDashboard → Create dashboard
- Add widget → Line → Metrics → select a service → pick a metric → Create widget
- Click Save dashboard
2
Amazon SNS
Create a Notification Topic
- Search for SNS and click it
- Topics → Create topic → Type: Standard → Name:
CloudWatch-Alerts→ Create topic - Create subscription → Protocol: Email → enter your email → Create subscription
- Click the confirmation link in your inbox
3
Amazon CloudWatch
Create a CPU Alarm
- CloudWatch → Alarms → Create alarm → Select metric
- EC2 → Per-Instance Metrics → CPUUtilization → Select metric
- Condition: Greater than → value:
80 - Notification: In alarm → select CloudWatch-Alerts topic
- Alarm name:
High-CPU-Alarm→ Create alarm
4
AWS Billing
Create a Billing Alarm
WARNING: Enable billing alerts first: AWS Console → account name → Billing and Cost Management → Billing preferences → enable CloudWatch billing alerts
- CloudWatch → Alarms → Create alarm → Select metric → Billing → Total Estimated Charge
- Select EstimatedCharges (USD) → Select metric
- Condition: Greater than → value:
10 - Notification: select CloudWatch-Alerts
- Alarm name:
Monthly-Billing-Alarm→ Create alarm
TIP: Set the threshold to $1 or $5 while learning to get early warning.
5
Amazon CloudWatch
Explore Log Groups
- CloudWatch → Log groups
- Find /aws/lambda/ContactFormHandler (if you completed Lab 03)
- Click a log stream to see every Lambda execution with timestamps
- Each START, END, and REPORT line shows duration and memory usage
Verification Checklist
- CloudWatch dashboard MyLabDashboard created with at least one widget
- SNS topic CloudWatch-Alerts created and subscription confirmed via email
- High-CPU-Alarm created linked to CloudWatch-Alerts
- Billing alerts enabled in Billing preferences
- Monthly-Billing-Alarm created at $10 threshold
What You Learned
- Amazon CloudWatch — dashboards, metrics, and alarms for monitoring
- Amazon SNS — email/SMS alerts triggered by CloudWatch alarms
- Billing alarms — protecting against unexpected AWS charges
- CloudWatch Logs — centralized log management for Lambda and other services
Lab Cleanup
IMPORTANT: Delete these resources when finished.
| # | Resource | How to Delete |
|---|---|---|
| 1 | CloudWatch Alarms | CloudWatch → Alarms → select both → Delete |
| 2 | CloudWatch Dashboard | CloudWatch → Dashboards → MyLabDashboard → Delete |
| 3 | SNS Subscription | SNS → Subscriptions → select → Delete |
| 4 | SNS Topic | SNS → Topics → CloudWatch-Alerts → Delete |
NOTE: Keep the billing alarm if you want ongoing cost protection — it costs nothing.