A SysOps Administrator is configuring a monitoring and remediation system for a custom application. The application runs on Amazon EC2 instances and publishes a custom metric named TransactionLatency every 10 seconds. The administrator needs to configure an Amazon CloudWatch alarm that triggers within 1 minute of a latency spike, and automatically runs an AWS Systems Manager Automation runbook to remediate the issue. Which two configuration steps should the administrator perform to meet these requirements? (Select TWO.)
- Publish the custom metric using the PutMetricData API with the StorageResolution parameter set to 1.Answer
- Create an Amazon EventBridge rule that detects when the CloudWatch alarm changes to the ALARM state, and targets the Systems Manager Automation runbook.Answer
- CEnable detailed monitoring on the EC2 instances hosting the application.
- DConfigure the CloudWatch alarm to directly execute the Systems Manager Automation runbook as an alarm action.
- ECreate an AWS Config rule to monitor the custom metric threshold and trigger the Systems Manager Automation runbook as a remediation action.
Answer
Publishing the custom metric with a storage resolution of 1, and creating an Amazon EventBridge rule that detects when the alarm changes to the ALARM state to target the Systems Manager Automation runbook.
To trigger an alarm within 1 minute, the underlying metric must support sub-minute evaluation periods. Setting the StorageResolution parameter to 1 in the PutMetricData call creates a high-resolution metric, allowing alarm evaluation periods of 10 or 30 seconds. Additionally, because CloudWatch alarms cannot directly call Systems Manager Automation runbooks, the correct approach to automated remediation is to configure an Amazon EventBridge rule that detects the alarm's state change and targets the runbook.
Step-by-Step Solution
Key Concept
High-resolution CloudWatch custom metrics and automated remediation using Amazon EventBridge