Question

Difficulty: MediumCloudWatch Metrics and Alarms

An organization runs a memory-sensitive workload on a standalone Amazon EC2 instance. To ensure stability, the instance must be automatically rebooted if the custom metric `AvailableMemory`—which is published every `55` minutes to a custom namespace—falls below `10241024` MB for two consecutive evaluation periods (a total of `1010` minutes). Which two configuration steps should a SysOps Administrator perform to achieve this requirement?

  1. Create a CloudWatch alarm on the `AvailableMemory` metric with a threshold of `10241024` MB, a period of `55` minutes, and evaluation periods set to `22`.Answer
  2. Configure an Amazon EventBridge rule that matches the CloudWatch alarm's state change to `ALARM`, and set the target to the `AWS-RestartEC2Instance` Systems Manager Automation runbook.Answer
  3. C
    Add an EC2 reboot action directly to the CloudWatch alarm configuration to restart the instance when the alarm enters the `ALARM` state.
  4. D
    Enable detailed monitoring on the EC2 instance to increase the reporting frequency of the `AvailableMemory` custom metric to `11-minute` intervals.
  5. E
    Configure an Auto Scaling group scaling policy with a `1010-minute` cooldown period to trigger the reboot action.

Answer

The SysOps Administrator must create a CloudWatch alarm with a threshold of `10241024` MB, a `55-minute` period, and `22` evaluation periods, and configure an Amazon EventBridge rule targeting the `AWS-RestartEC2Instance` Systems Manager Automation runbook on alarm state changes.
To satisfy the requirements, the CloudWatch alarm must evaluate the `AvailableMemory` metric over a `55-minute` period for `22` consecutive evaluation periods to span the `1010-minute` window. Additionally, since the metric belongs to a custom namespace, the built-in EC2 actions (such as reboot or recover) cannot be attached directly to the alarm. Instead, an Amazon EventBridge rule must be configured to intercept the alarm's state change to `ALARM` and trigger the `AWS-RestartEC2Instance` Systems Manager Automation runbook to reboot the instance.

Step-by-Step Solution

1
Determine the alarm threshold, period, and evaluation periods settings.
Set the threshold to `10241024` MB, period to `55` minutes, and evaluation periods to `22`.
Since the metric is published every `55` minutes, a `55-minute` period is required. Checking for two consecutive periods ensures that the condition persists for `1010` minutes before triggering the alarm.
2
Determine how to execute the reboot action on the EC2 instance.
Create an EventBridge rule that triggers the Systems Manager Automation runbook `AWS-RestartEC2Instance` when the alarm state changes to `ALARM`.
Custom metrics do not support built-in EC2 alarm actions (like reboot). EventBridge must route the state change to an SSM runbook to perform the reboot.

Key Concept

CloudWatch Custom Metric Alarms and Remediation Actions
Rate this question