Q95 — AWS DOP-C02 Ch.1
Question 95 of 100 | ← Chapter 1
A company runs an application on Amazon EC2 instances. The application requires frequent restarts. When a restart is needed, application logs emit error messages. Application logs are published to a log group in Amazon CloudWatch Logs. When log entries contain restart-related error messages, an Amazon CloudWatch alarm notifies application engineers via an Amazon Simple Notification Service (Amazon SNS) topic. After receiving the SNS notification, engineers manually restart the application on the instance.
- A. Configure an AWS Systems Manager Automation runbook that runs a script to restart the application on the instance. Configure the SNS topic to invoke the runbook.
- B. Create an AWS Lambda function that restarts the application on the instance. Configure the Lambda function as the event destination for the SNS topic.
- C. Configure an AWS Systems Manager Automation runbook that runs a script to restart the application on the instance. Create an AWS Lambda function to invoke the runbook. Configure the Lambda function as the event destination for the SNS topic.
- D. Configure an AWS Systems Manager Automation runbook that runs a script to restart the application on the instance. Configure an Amazon EventBridge rule that reacts when the CloudWatch alarm enters the ALARM state. Specify the runbook as the rule’s target. ✓
Correct Answer: D. Configure an AWS Systems Manager Automation runbook that runs a script to restart the application on the instance. Configure an Amazon EventBridge rule that reacts when the CloudWatch alarm enters the ALARM state. Specify the runbook as the rule’s target.
Explanation
Amazon EventBridge rules can directly respond to CloudWatch alarm state changes (e.g., entering ALARM) and invoke AWS Systems Manager Automation runbooks—eliminating intermediate services like SNS or Lambda. This reduces latency, operational complexity, and potential failure points. Systems Manager Automation executes scripts directly on the target EC2 instance to restart the application without rebooting the entire instance. Option D provides the most efficient, streamlined workflow. Options A, B, and C introduce unnecessary hops (SNS → runbook, SNS → Lambda → runbook, or SNS → Lambda → runbook), increasing overhead and delay.