Target the AWS-RestartEC2Instance Automation runbook from an AWS Health event rule for termination and retirement events
A company's DevOps engineer uses AWS Systems Manager to perform maintenance tasks. The company has a few Amazon EC2 instances that require a restart after notifications from AWS Health. The DevOps engineer must implement an automated solution that uses Amazon EventBridge to remediate the notifications during the company's scheduled maintenance windows. How should the DevOps engineer configure an EventBridge rule to meet these requirements?
Community Votes
69% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
AWS Health is the event source that emits instance retirement and scheduled termination events, so the rule must be bound to it with those specific event types (A). Systems Manager Automation runbooks such as AWS-RestartEC2Instance perform the restart natively, which removes the need for the Lambda function that options C and D introduce to register a maintenance window task. Option B uses Systems Manager as the event source, which does not emit AWS Health notifications, so it would never fire for these events.
The remediation must be driven by AWS Health notifications about EC2 instance retirement and scheduled termination, and must be executed by AWS Systems Manager Automation. Configuring an EventBridge rule with AWS Health as the event source, selecting the event types that indicate scheduled instance termination and retirement, and targeting the AWS-RestartEC2Instance Systems Manager Automation runbook restarts the instances in response to those notifications.
Configuring a Systems Manager event source with a maintenance window event type (B) — Systems Manager is not the source of EC2 retirement notifications, so a rule on that source never receives the AWS Health events described in the scenario. Using an AWS Lambda function to register a Systems Manager maintenance window task (C and D) — this adds a function to invoke and maintain, whereas the AWS-RestartEC2Instance Automation document restarts the instance directly. Note that several commenters preferred C on the grounds that it respects the maintenance window, but the requirement's trigger is the AWS Health notification and the Automation runbook is the native remediation path.
Community Discussion (8 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
The notifications that drive this automation are AWS Health events, so the EventBridge rule must use AWS Health as its event source and select the event types indicating scheduled instance termination and instance retirement. The remediation itself is a Systems Manager Automation document, and AWS-RestartEC2Instance is the provided runbook for restarting EC2 instances, so the rule targets that runbook (A). This wires the Health notification directly to a managed remediation document, which is the smallest possible amount of automation for the stated requirement.Why the Other Options Are Wrong
B configures Systems Manager as the event source with a maintenance window event type. Systems Manager does not emit EC2 retirement or scheduled termination notifications, so a rule bound to that source would never receive the events described. D configures EC2 as the event source with an instance state-change event type and routes to a Lambda function. Instance state-change events do not carry the AWS Health retirement and termination notifications that trigger this workflow, and using a Lambda adds code to maintain. C uses the correct AWS Health event source and event types but routes to a newly created Lambda function that registers a Systems Manager maintenance window task, which is an unnecessary indirection compared with invoking the Automation runbook directly; c87b433 and gildzeee preferred C because they read the maintenance-window constraint as requiring a scheduled task, but the requirement's stated trigger is the Health notification and the Automation document is the native remediation mechanism. A is the correct answer.Community Comment Notes
Community voted A (69), with C a 31 percent minority. Srikantha and tinyshare supported A, noting that AWS Health provides event types for scheduled instance termination and instance retirement and that the Automation runbook performs the restart. devops_1, c87b433, and gildzeee preferred C on the grounds that it honors the maintenance window, which is a reasonable reading of the wording, but A is the AWS-native remediation path with the least overhead.Official Reference
Related Analysis
Practice All DOP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full DOP-C02 Practice Test →