

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Monitoring
incomplete
2: Monitoring Targets
incomplete
3: External Monitoring
incomplete
4: Internal Monitoring
incomplete
5: CloudWatch Alarms
incomplete
6: CloudTrail
incomplete
7: Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Our metrics and logs are being sent to AWS, but we have to check them manually to find out if something is wrong. Not ideal...
CloudWatch Alarms lets us set up automatic "actions" to be taken when certain criteria are met. For example:
5XX errors!Let's create a simple alarm that triggers when our server goes above 20% CPU usage. When triggered, it will send a notification via SNS (Simple Notification Service) to a given email address.
Create a CloudWatch alarm that trigger an email when CPU usage exceeds 20%.
Cost check: CloudWatch Alarms are free for the first 10 alarms. SNS notifications cost $0.50 per 100,000 requests.
When you first create an alarm, it may show Insufficient data; this just means it hasn't gathered enough data points yet to make a decision. This will resolve itself after a few periods.
ssh patientping
yes > /dev/null
If that all worked, run and submit the CLI tests.
Want to use the AWS CLI instead? Here's the command structure:
# Create SNS topic
aws sns create-topic --name TOPIC-NAME
# Subscribe email address to topic
aws sns subscribe --topic-arn TOPIC-ARN --protocol email --notification-endpoint EMAIL-ADDRESS
# Create alarm
aws cloudwatch put-metric-alarm --alarm-name ALARM-NAME --metric-name METRIC-NAME --namespace NAMESPACE --statistic Average --period PERIOD-SECONDS --threshold THRESHOLD --comparison-operator GreaterThanThreshold --evaluation-periods 1 --alarm-actions TOPIC-ARN