Q: 9
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?
Options
Discussion
D looks right, but only if you don't need to track login method. If you had to react to console logins only, you might need extra parsing and maybe A would edge ahead. Here, D hits all requirements assuming logs are properly ingested.
Had something like this in a mock and picked D. Only D wires up the whole thing automatically: Lambda gets triggered by log subscription, tags the instance, EventBridge rule handles termination without any manual steps. Pretty sure that's what AWS wants here, but open if someone thinks otherwise.
A is wrong, D. Only D fully automates the process without needing humans, tagging and cleanup both handled by Lambda/EventBridge.
D tbh. B is a trap since it needs manual intervention.
B
Be respectful. No spam.