AWS Certified DevOps Engineer – Professional — Question 121

A developer is maintaining a fleet of 50 Amazon EC2 Linux servers. The servers are part of an Amazon EC2 Auto Scaling group, and also use Elastic Load Balancing for load balancing.

Occasionally, some application servers are being terminated after failing ELB HTTP health checks. The developer would like to perform a root cause analysis on the issue, but before being able to access application logs, the server is terminated.

How can log collection be automated?

Answer options

Correct answer: D

Explanation

Option D is correct because it effectively uses Auto Scaling lifecycle hooks to pause the termination process, allowing for log collection via an AWS Lambda function triggered by an EventBridge rule. The other options either use incorrect services or states that do not align with the requirement to collect logs before termination.