AWS Certified DevOps Engineer – Professional — Question 161

A production account has a requirement that any Amazon EC2 instance that has been logged in to manually must be terminated within 24 hours. All applications in the production account are using Auto Scaling groups with the Amazon CloudWatch Logs agent configured.

How can this process be automated?

Answer options

Correct answer: D

Explanation

Option D is correct because it automates the tagging of the EC2 instance that has been logged into and schedules its termination via an EventBridge rule. Option A incorrectly suggests using AWS Step Functions, which is unnecessary for this task. Option B relies on manual intervention from the operations team, failing to automate the process, while option C introduces unnecessary complexity by using an SQS queue and worker instances instead of directly tagging and terminating the instances.