0
0
AWScloud~10 mins

CloudWatch alarms in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - CloudWatch alarms
Metric data collected
Evaluate metric against threshold
Threshold met
Trigger actions
Wait for next evaluation
CloudWatch alarms watch metrics and compare them to a set limit. If the metric crosses the limit, the alarm changes state and can trigger actions.
Execution Sample
AWS
Metric: CPUUtilization
Threshold: 70
Period: 1 min
Evaluate every 1 min
Alarm action: Send notification
This alarm checks CPU usage every minute. If CPU usage goes above 70%, it triggers a notification.
Process Table
StepMetric Value (%)Condition (Value > 70?)Alarm StateAction Taken
165NoOKNo action
272YesALARMSend notification
375YesALARMNo action
468NoOKNo action
569NoOKNo action
671YesALARMSend notification
💡 Alarm evaluates metric every minute; stops when monitoring ends or alarm deleted.
Status Tracker
VariableStartAfter 1After 2After 3After 4After 5After 6
Metric Value (%)N/A657275686971
Alarm StateOKOKALARMALARMOKOKALARM
Action TakenNoneNoneNotification sentNoneNoneNoneNotification sent
Key Moments - 3 Insights
Why does the alarm state change back to OK after being ALARM?
Because the metric value dropped below the threshold (see step 4 in execution_table), the alarm returns to OK state.
Does the alarm send notifications every time the metric is above threshold?
No, only when the alarm transitions to the ALARM state (steps 2 and 6). In step 3, the metric is still above threshold but the state was already ALARM, so no action is triggered.
What happens if the metric value equals the threshold exactly?
The alarm triggers only if the value is greater than the threshold, not equal. So equal values keep alarm state OK.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the alarm state at step 5?
AOK
BALARM
CINSUFFICIENT_DATA
DUNKNOWN
💡 Hint
Check the 'Alarm State' column for step 5 in the execution_table.
At which step does the alarm first send a notification?
AStep 1
BStep 2
CStep 4
DStep 5
💡 Hint
Look at the 'Action Taken' column to find when 'Send notification' first appears.
If the threshold was changed to 65%, what would be the alarm state at step 1?
AOK
BINSUFFICIENT_DATA
CALARM
DUNKNOWN
💡 Hint
Compare the metric value at step 1 with the new threshold in the variable_tracker.
Concept Snapshot
CloudWatch alarms watch a metric over time.
They compare metric values to a threshold.
If metric > threshold, alarm state becomes ALARM.
Alarm can trigger actions like notifications.
Alarm state returns to OK if metric falls below threshold.
Evaluations happen at set intervals.
Full Transcript
CloudWatch alarms monitor metrics like CPU usage. Every evaluation period, the alarm checks if the metric is above a set threshold. If yes, the alarm state changes to ALARM and triggers actions such as notifications. If the metric falls below the threshold, the alarm state returns to OK. This process repeats at each evaluation interval, allowing continuous monitoring and alerting.