Target the AWS-RestartEC2Instance Automation runbook from an AWS Health event rule for termination and retirement events

Answer Correct answer: A — use an AWS Health event rule for termination and retirement events targeting the AWS-RestartEC2Instance Automation runbook.

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?

  1. Configure an event source of AWS Health. Configure event types that indicate scheduled instance termination and retirement. Target the AWS-RestartEC2Instance Systems Manager Automation runbook to restart the EC2 instances. Correct Answer
  2. Configure an event source of Systems Manager. Configure an event type that indicates a maintenance window. Target the AWS-RestartEC2Instance Systems Manager Automation runbook to restart the EC2 instances.
  3. Configure an event source of AWS Health. Configure event types that indicate scheduled instance termination and retirement. Target a newly created AWS Lambda function that registers a Systems Manager maintenance window task to restart the EC2 instances.
  4. Configure an event source of EC2. Configure an event type that indicates instance state notification. Target a newly created AWS Lambda function that registers a Systems Manager maintenance window task to restart the EC2 instances.

Community Votes

A
69%
C
31%

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)

Srikantha 👍 1 Selected: A
Event Source of AWS Health: The DevOps engineer wants to act on AWS Health notifications. AWS Health provides event types for scheduled instance terminations and instance retirements, which are common reasons for needing to restart EC2 instances during a maintenance window. Event Types: EventBridge can be configured to listen for event types like EC2 Instance Termination or EC2 Instance Retirement to automate instance restarts when these events occur. Target Systems Manager Automation Runbook: AWS Systems Manager Automation runbooks such as AWS-RestartEC2Instance are pre-defined automation workflows that can restart EC2 instances. When triggered by EventBridge, this runbook can automatically restart the EC2 instances that need remediation.
devops_1 👍 1 Selected: C
Option A does not satisfy the maintenance window requirement
c87b433 👍 1 Selected: C
C is the right answer. A will do action immediately but using lambda we can create a maintenance window according to organization downtime activity. A could have been the right answer, but it takes immediate action on an event that is not required. We have to do this in a particular time.
gildzeee 👍 1 Selected: C
question states during the maintenance window not immediately
tinyshare 👍 4 Selected: A
Same as the question 20, A is correct.
phu0298 👍 3 Selected: A
C. Lambda Function to Register a Maintenance Window Task • While this approach could work, it unnecessarily complicates the solution. AWS Systems Manager and EventBridge provide native integrations that eliminate the need for a custom Lambda function. Therefore the answer should be A
Changwha 👍 3 Selected: A
AWS Health provides notifications for events such as scheduled instance termination and decommissioning.
Impromptu 👍 2 Selected: C
Although a bit more complex than A, I think C is best. Option A would just restart the instance when the event was received, and not withing the company's maintenance windows.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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 →

← Back to DOP-C02 Study Guide