Automate EC2 Reboot with Systems Manager Maintenance Windows
Short answer
B Use AWS Systems Manager to create a daily maintenance window outside of business hours, register the EC2 instances as targets, and assign the AWS-RestartEC2Instance runbook to the maintenance window.
Question
The cause of the crashes is a memory leak in the application. While developers work to fix the problem, a CloudOps engineer needs to implement a temporary solution. The solution must automatically reboot the EC2 instances every day and must minimize application disruption during business hours.
Which solution will meet these requirements?
Key Takeaways
The core trap is choosing CloudWatch alarms for scheduled daily reboots; alarms are event-driven and cannot trigger on a calendar schedule, whereas Systems Manager Maintenance Windows are designed specifically for scheduled maintenance tasks.
This question tests the use of AWS Systems Manager Maintenance Windows to schedule automated EC2 instance restarts during low-traffic periods, minimizing business disruption caused by application memory leaks.
Common mistake: Candidates often select Option C, assuming that monitoring system health metrics can automate a scheduled reboot. However, CloudWatch alarms only react to threshold breaches, not time-based schedules, making them unsuitable for this specific requirement.
Expert Analysis
Why the Answer Is Correct
Option B is the correct solution because AWS Systems Manager Maintenance Windows allow you to define specific windows of time for performing maintenance tasks. By scheduling the window outside of business hours and using the AWS-RestartEC2Instance runbook, the engineer ensures that instances are automatically rebooted daily without impacting users during peak times. This approach provides the necessary automation while adhering to the constraint of minimizing disruption.
Why the Other Options Are Wrong
Option A is incorrect because Amazon EventBridge rules can be scheduled, but the StartInstances API call starts stopped instances; it does not reboot running instances. To reboot an instance via EventBridge, you would need a Lambda function or another mechanism, making it less direct than SSM. Option C is incorrect because CloudWatch alarms are triggered by metric thresholds (like status checks failing), not by a daily schedule. They cannot enforce a proactive daily reboot. Option D is incorrect for similar reasons: alarms react to events after they happen, and restarting an application is not the same as rebooting the instance, nor does it solve the timing issue of doing it during business hours.
Community Comment Notes
Community consensus strongly favors Option B. As Bad_Mat noted, "Use AWS Systems Manager to create a daily maintenance window..." is the standard best practice for scheduled maintenance on EC2 fleets. The comments highlight that other options fail to meet the 'automatically' and 'outside business hours' constraints simultaneously.
Exam Strategy
Always distinguish between event-driven actions (CloudWatch Alarms) and time-driven actions (EventBridge Schedules or Systems Manager Maintenance Windows). For scheduled maintenance on AWS resources, Maintenance Windows is the dedicated service.
Frequently Asked Questions
Why can't I use a CloudWatch alarm to reboot instances daily?
Does StartInstances reboot a running EC2 instance?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
Bad_Mat 👍 1 Answered BB. Use AWS Systems Manager to create a daily maintenance window that is outside of business hours. Register the EC2 instances as a target. Assign the AWS-RestartEC2Instance runbook to the maintenance window
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SOA-C03 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SOA-C03 Practice Test →