A SysOps Administrator is designing an automated remediation workflow for a batch-processing application running on Amazon EC2 instances. The application publishes a custom metric named `QueueBacklogDepth` to Amazon CloudWatch at 1-minute intervals. The administrator wants to automatically execute the `AWS-RestartEC2Instance` Systems Manager (SSM) Automation runbook if the backlog depth exceeds 1,000 messages for a duration of 15 minutes.
The administrator configures a CloudWatch alarm for the `QueueBacklogDepth` metric with a threshold of 1,000, a period of 5 minutes (300 seconds), and evaluation periods of 3. During testing, the queue backlog depth exceeds 1,000 for 20 minutes, and the alarm state successfully transitions to ALARM, but the SSM Automation runbook fails to run.
How should the administrator resolve this issue to ensure the remediation workflow executes successfully?
- Create an Amazon EventBridge rule that triggers on a CloudWatch Alarm State Change event for this alarm to invoke the Systems Manager Automation runbook as the target.Answer
- BEnable detailed monitoring on the EC2 instances hosting the application to allow CloudWatch to receive and evaluate the custom metric at the 1-minute resolution required by the evaluation period configuration.
- CConfigure the Systems Manager Automation runbook as a subscription endpoint on an Amazon SNS topic, and update the CloudWatch alarm actions to publish to that SNS topic.
- DReduce the Auto Scaling group cooldown period to be less than the 15-minute evaluation window to prevent the alarm actions from being suppressed.