Q77 — AWS DOP-C02 Ch.2
Question 77 of 100 | ← Chapter 2
An e-commerce company uses Amazon EC2 instances backed by Amazon EBS volumes. To reduce manual effort for managing instances, a DevOps engineer must automatically restart EC2 instances when scheduled maintenance events occur. How can this be achieved?
- A. Create a scheduled Amazon CloudWatch Events rule to execute an AWS Systems Manager Automation document that checks whether any EC2 instance is scheduled for weekly shutdown. If scheduled, the automation document puts the instance into hibernation.
- B. Enable EC2 auto-recovery on all instances. Create an AWS Config rule to restrict recovery to occur only during approved maintenance windows.
- C. Restart all EC2 instances during approved maintenance windows outside standard business hours. Set up Amazon CloudWatch alarms to notify when any instance fails an EC2 instance status check.
- D. Set up an AWS Health Amazon CloudWatch Events rule to execute an AWS Systems Manager Automation document that stops and starts EC2 instances upon occurrence of a scheduled maintenance event. ✓
Correct Answer: D. Set up an AWS Health Amazon CloudWatch Events rule to execute an AWS Systems Manager Automation document that stops and starts EC2 instances upon occurrence of a scheduled maintenance event.
Explanation
AWS Health publishes service events—including scheduled maintenance—and integrates with Amazon CloudWatch Events to trigger automated responses. AWS Systems Manager Automation documents can be invoked via CloudWatch Events to perform precise remediation actions like stopping and starting EC2 instances in response to AWS Health maintenance notifications. This approach is documented in AWS best practices for automating remediation for EC2 notifications. Option D directly implements this pattern. Option A uses generic scheduling rather than reacting to actual AWS Health events. Option B misuses auto-recovery, which responds to instance failures—not scheduled maintenance. Option C relies on manual scheduling and lacks automation tied to AWS Health events.