How should the solutions architect gain access to an EC2 instance to troubleshoot the issue?
Suspend the Auto Scaling group’s HealthCheck scaling process. Use Session Manager to log in to an instance that is marked as unhealthy.
Enable EC2 instance termination protection. Use Session Manager to log in to an instance that is marked as unhealthy.
Set the termination policy to OldestInstance on the Auto Scaling group. Use Session Manager to log in to an instance that is marked an unhealthy.
Suspend the Auto Scaling group’s Terminate process. Use Session Manager to log in to an instance that is marked as unhealthy.
Explanations:
Suspending the Auto Scaling group’s HealthCheck scaling process would stop new health checks from being performed, but it will not prevent unhealthy instances from being terminated. Session Manager can be used, but this option does not address the termination process that causes the instance to be replaced.
Enabling EC2 instance termination protection prevents the instance from being terminated, but this only affects manual terminations, not automatic terminations due to health checks. This option does not address the Auto Scaling termination process triggered by health checks.
Changing the termination policy to OldestInstance only affects which instance is terminated when scaling down, but does not prevent the instance from being marked as unhealthy or terminated. This option does not prevent automatic instance termination due to health checks.
Suspending the Auto Scaling group’s Terminate process prevents the Auto Scaling group from terminating instances due to failed health checks, allowing the solution architect to log in via Session Manager to troubleshoot the issue. This option directly addresses the issue of instances being automatically terminated.