
Ultimate access to all questions.
In a production environment, there is a requirement to automatically terminate any Amazon EC2 instance that is manually logged into within 24 hours. All applications in this environment utilize Auto Scaling groups and are configured with the Amazon CloudWatch Logs agent. What is the most efficient way to automate this termination process?
A
Set up a CloudWatch Logs subscription to an AWS Step Functions application. Implement an AWS Lambda function to tag the EC2 instance that triggered the login event for decommissioning. Establish an Amazon EventBridge rule to execute a second Lambda function daily to terminate instances marked with this tag.
B
Configure an Amazon CloudWatch alarm to respond to the login event. Route the alarm notification to an Amazon Simple Notification Service (Amazon SNS) topic subscribed by the operations team, who will manually terminate the EC2 instance within 24 hours.
C
Design an Amazon CloudWatch alarm to react to the login event. Set the alarm to dispatch to an Amazon Simple Queue Service (Amazon SQS) queue. Utilize a cluster of worker instances to handle messages from the queue, which subsequently triggers an Amazon EventBridge rule to initiate the termination process.
D
Develop a CloudWatch Logs subscription to an AWS Lambda function. Program the function to tag the EC2 instance that generated the login event for decommissioning. Create an Amazon EventBridge rule to activate a daily Lambda function that terminates all instances tagged for decommissioning.