A SysOps administrator needs to automatically stop any Amazon EC2 instance that transitions to the running state in a development AWS account. Which configuration will achieve this with the least operational overhead?
- AConfigure an Amazon EventBridge rule that filters for EC2 Instance State-change Notification events, and configure the target to be an AWS Config custom compliance rule that triggers an instance shutdown.
- Create an Amazon EventBridge rule that filters for EC2 Instance State-change Notification events where the state is running, and configure the target to execute the AWS-StopEC2Instance Systems Manager Automation runbook.Answer
- CCreate an Amazon EventBridge rule that targets the Systems Manager Automation runbook, configuring an IAM service role for EventBridge but omitting the iam:PassRole permission from the administrator's policy.
- DEnable detailed monitoring on the EC2 instances to reduce the state-change metric latency to 1 minute, and configure a CloudWatch alarm to trigger an Auto Scaling policy that stops the instance.
Answer
Create an Amazon EventBridge rule that filters for EC2 Instance State-change Notification events where the state is running, and configure the target to execute the AWS-StopEC2Instance Systems Manager Automation runbook.
The correct answer is to use an Amazon EventBridge rule that filters for EC2 Instance State-change Notification events and targets the AWS-StopEC2Instance runbook. EventBridge provides a direct, native, and near-real-time integration with Systems Manager Automation without requiring additional monitoring configurations or custom code, making it the option with the least operational overhead.
Step-by-Step Solution
Key Concept
Using Amazon EventBridge rules to target AWS Systems Manager Automation runbooks for automated event-driven remediation of resource states.
Estimated Time:1m 0s