AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 311
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?
Answer options
- A. 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.
- B. 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.
- C. 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.
- D. 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.
Correct answer: A
Explanation
Option A is correct because AWS Health events (such as scheduled instance retirement or termination) can directly trigger an Amazon EventBridge rule. The rule can target the pre-built AWS-RestartEC2Instance Systems Manager Automation runbook to safely reboot the instances without needing custom AWS Lambda functions or manual intervention. Other options either use incorrect event sources or introduce unnecessary complexity like custom Lambda functions to register maintenance window tasks.