Question

Difficulty: HardCloudWatch Metrics and Alarms

A SysOps Administrator is managing an application on a standalone Amazon EC2 instance. The administrator configures a custom script on the instance to publish a custom metric named ActiveConnections to Amazon CloudWatch every 10 seconds. The administrator then creates a CloudWatch alarm with a period of 10 seconds and an evaluation period of 3 to monitor this metric. The goal is to automatically trigger an AWS Systems Manager (SSM) Automation runbook to reboot the instance if active connections exceed 500.

During a traffic spike, the active connections exceeded 500 for several minutes, but the alarm remained in the INSUFFICIENT_DATA state and the instance did not reboot.

Which two of the following configuration changes will resolve these issues and ensure the automated reboot executes successfully? (Select TWO.)

  1. Modify the custom script to publish the metric with the StorageResolution parameter set to 1.Answer
  2. Configure an Amazon EventBridge rule that intercepts the CloudWatch alarm state change and targets the Systems Manager Automation runbook.Answer
  3. C
    Enable detailed monitoring on the EC2 instance to allow the custom metric to be evaluated at 1-minute intervals.
  4. D
    Add a direct action in the CloudWatch alarm configuration to trigger the Systems Manager Automation runbook.
  5. E
    Adjust the Auto Scaling group cooldown period to prevent the alarm from entering the INSUFFICIENT_DATA state during reboots.

Answer

The issues can be resolved by modifying the script to publish the custom metric with a StorageResolution of 1, and configuring an Amazon EventBridge rule to intercept the alarm state change and trigger the Systems Manager Automation runbook.
To support a CloudWatch alarm with a sub-minute period (like 10 seconds), the underlying metric must be published with a StorageResolution of 1, indicating high resolution. Standard resolution metrics are aggregated at 1-minute intervals, which causes shorter-period alarms to evaluate with insufficient data. Additionally, CloudWatch alarms do not support executing Systems Manager Automation runbooks as a direct alarm action. The state transition must be intercepted by Amazon EventBridge to invoke the Automation runbook.

Step-by-Step Solution

1
Analyze the cause of the INSUFFICIENT_DATA state for a 10-second period alarm.
By default, custom metrics are stored with standard resolution (1-minute intervals). Publishing data every 10 seconds without specifying high-resolution storage causes CloudWatch to aggregate data at 1-minute intervals, leaving the 10-second periods empty and resulting in INSUFFICIENT_DATA.
To fix this, the metric must be published as a high-resolution metric by setting the StorageResolution parameter to 1.
2
Analyze the cause of the failed automated reboot execution.
CloudWatch alarms cannot directly invoke Systems Manager Automation runbooks from their native alarm actions list.
To remediate this, you must configure an Amazon EventBridge rule that detects when the alarm enters the ALARM state and executes the Systems Manager Automation runbook as its target.

Key Concept

CloudWatch High-Resolution Alarms and Systems Manager Remediation Integration
Estimated Time:2m 30s
Rate this question