An alarm action is what happens when a CloudWatch alarm changes state. It can send notifications or trigger other AWS services like Auto Scaling.
Click to reveal answer
beginner
How does SNS work with CloudWatch alarms?
SNS (Simple Notification Service) sends messages to subscribers like email or SMS when a CloudWatch alarm triggers.
Click to reveal answer
intermediate
What happens when a CloudWatch alarm triggers an Auto Scaling action?
The Auto Scaling group adjusts the number of instances, either adding or removing them based on the alarm's condition.
Click to reveal answer
intermediate
Can a CloudWatch alarm have multiple actions?
Yes, an alarm can trigger multiple actions like sending SNS notifications and scaling Auto Scaling groups at the same time.
Click to reveal answer
beginner
Why use Auto Scaling with CloudWatch alarms?
It helps keep your application healthy and cost-efficient by automatically adjusting resources based on real-time metrics.
Click to reveal answer
What does SNS do when triggered by a CloudWatch alarm?
ASends notifications to subscribers
BDeletes EC2 instances
CCreates new CloudWatch metrics
DStops Auto Scaling groups
✗ Incorrect
SNS sends notifications like emails or SMS to subscribers when a CloudWatch alarm triggers.
Which AWS service can automatically add or remove instances based on CloudWatch alarms?
ALambda
BSNS
CAuto Scaling
DS3
✗ Incorrect
Auto Scaling adjusts the number of instances automatically based on CloudWatch alarm triggers.
Can a CloudWatch alarm trigger both SNS notifications and Auto Scaling actions simultaneously?
AOnly if using Lambda
BNo
COnly one action per alarm
DYes
✗ Incorrect
CloudWatch alarms can trigger multiple actions including SNS notifications and Auto Scaling.
What is the main benefit of linking CloudWatch alarms to Auto Scaling?
AManual instance management
BAutomatic resource adjustment
CFaster SNS notifications
DCreating new alarms
✗ Incorrect
Linking alarms to Auto Scaling allows automatic adjustment of resources based on metrics.
Which of these is NOT a valid CloudWatch alarm action?
ADirectly modify S3 bucket policies
BTrigger Auto Scaling
CSend SNS notification
DInvoke Lambda function
✗ Incorrect
CloudWatch alarms do not directly modify S3 bucket policies as an action.
Explain how CloudWatch alarms can help manage Auto Scaling groups.
Think about monitoring, triggering, and adjusting resources automatically.
You got /4 concepts.
Describe the role of SNS in alarm actions and why it is useful.
Consider how alerts reach users or other systems.
You got /4 concepts.
Practice
(1/5)
1. What is the primary purpose of connecting an AWS CloudWatch alarm to an SNS topic?
easy
A. To create backups of alarm configurations
B. To send notifications when the alarm state changes
C. To store alarm history logs
D. To automatically scale EC2 instances
Solution
Step 1: Understand SNS topic role
SNS topics are used to send messages or notifications to subscribers.
Step 2: Connect alarm to SNS for notifications
When an alarm changes state, it can trigger SNS to notify users or systems.
Final Answer:
To send notifications when the alarm state changes -> Option B
Quick Check:
Alarm + SNS = Notifications [OK]
Hint: SNS topics send messages on alarm changes [OK]
Common Mistakes:
Confusing SNS with Auto Scaling actions
Thinking SNS stores logs
Assuming SNS creates backups
2. Which of the following is the correct way to specify an Auto Scaling action in a CloudWatch alarm configuration?
easy
A. {
"AlarmActions": ["arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-name:policyName/policy-name"]
}
B. AlarmActions: ["arn:aws:sns:region:account-id:topic-name"]
C. AlarmActions: ["arn:aws:lambda:region:account-id:function:function-name"]
D. AlarmActions: ["arn:aws:s3:::bucket-name"]
Solution
Step 1: Identify correct ARN format for Auto Scaling policy
Auto Scaling policy ARNs include 'autoscaling' and specify scalingPolicy and group name.
Step 2: Match with given options
{
"AlarmActions": ["arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-name:policyName/policy-name"]
} matches the correct ARN format for Auto Scaling alarm action.
Final Answer:
Correct Auto Scaling policy ARN format -> Option A
Quick Check:
Auto Scaling action uses autoscaling ARN [OK]
Hint: Auto Scaling ARNs contain 'autoscaling' keyword [OK]
Common Mistakes:
Using SNS ARN instead of Auto Scaling ARN
Confusing Lambda or S3 ARNs as alarm actions
Incorrect ARN structure
3. Given this CloudWatch alarm configuration snippet:
What happens when the CPU utilization exceeds 80% for 2 evaluation periods?
medium
A. An SNS notification is sent to subscribers of the NotifyMe topic
B. The EC2 instance automatically scales up
C. The alarm resets without any action
D. A Lambda function is triggered
Solution
Step 1: Analyze AlarmActions ARN
The AlarmActions list contains an SNS topic ARN, meaning notifications are sent on alarm.
Step 2: Understand alarm trigger
When CPUUtilization > 80% for 2 periods, alarm state changes and triggers SNS notification.
Final Answer:
An SNS notification is sent to subscribers of the NotifyMe topic -> Option A
Quick Check:
Alarm with SNS ARN sends notifications [OK]
Hint: SNS ARN in AlarmActions means notification sent [OK]
Common Mistakes:
Assuming Auto Scaling happens without scaling policy
Thinking alarm resets silently
Confusing SNS with Lambda triggers
4. You configured a CloudWatch alarm to trigger an Auto Scaling policy, but the instances are not scaling when the alarm state changes. What is the most likely cause?
medium
A. The EC2 instances are stopped
B. The SNS topic subscription is missing
C. The alarm threshold is set too low
D. The alarm's AlarmActions does not include the correct Auto Scaling policy ARN
Solution
Step 1: Check AlarmActions configuration
If the Auto Scaling policy ARN is missing or incorrect, the alarm cannot trigger scaling.
Step 2: Rule out other options
SNS subscription missing affects notifications, not scaling. Threshold too low triggers alarm but no scaling if policy missing. Stopped instances do not scale but alarm triggers still need correct action.
Final Answer:
The alarm's AlarmActions does not include the correct Auto Scaling policy ARN -> Option D
Quick Check:
Correct Auto Scaling ARN needed in AlarmActions [OK]
Hint: Auto Scaling needs correct policy ARN in AlarmActions [OK]
Common Mistakes:
Confusing SNS subscription with scaling trigger
Ignoring ARN correctness
Assuming stopped instances auto scale
5. You want to automatically increase the number of EC2 instances when CPU usage is high and send a notification to your team. Which combination of alarm actions should you configure?
hard
A. Add only the Auto Scaling policy ARN to AlarmActions
B. Add only the SNS topic ARN to AlarmActions
C. Add both the Auto Scaling policy ARN and the SNS topic ARN to the alarm's AlarmActions
D. Create two separate alarms, one for scaling and one for notifications
Solution
Step 1: Understand alarm actions for scaling and notifications
To scale automatically, the alarm must trigger the Auto Scaling policy. To notify, it must trigger the SNS topic.
Step 2: Combine both actions in one alarm
Adding both ARNs in AlarmActions ensures the alarm triggers scaling and sends notifications simultaneously.
Final Answer:
Add both the Auto Scaling policy ARN and the SNS topic ARN to the alarm's AlarmActions -> Option C