The requirement is to automate recovery if the service crashes on any of the EC2 instances.Option A: Install the Amazon CloudWatch agent on the EC2 instances. Configure the CloudWatch agent to monitor the service.Set the CloudWatch action to restart if the service health check fails .This is a valid solutionbecause the CloudWatch agent can be configured to monitor the service and take action (restart the service) if the health check fails .Option C: Tag the EC2 instances. Use AWS Systems Manager State Manager to create an association that uses the AWS-RunShellScript document. Configure the association command with a script that checks if the service isrunning and that starts the service if the service is not running. For targets, specify the EC2 instance tag.Schedule the association to run every 5 minutes678. This is a valid solution because AWS Systems Manager StateManager can be used to maintain a consistent state of the EC2 instances.It can run a script to check if the service is running and start the service if it's not running678.Option B: Tag the EC2 instances. Create an AWS Lambda function that uses AWS Systems Manager Session Manager to log in to the tagged EC2 instances and restart the service.Schedule the Lambda function to run every 5minutes . This is not a valid solution because AWS Lambda functions are not designed to log in to EC2 instances and restart services. They are used for running serverless applications.Option D: Update the EC2 user data that is specified in the Auto Scaling group's launch template to include a script that runs on a cron schedule every 5 minutes131415. This is not a valid solution because user data scripts arerun only during the launch of an EC2 instance. They are not designed to run on a schedule.Option E: Update the EC2 user data that is specified in the Auto Scaling group's launch template to ensure that the service runs during startup.Redeploy all the EC2 instances in the Auto Scaling group with the updated launchtemplate131416. This is not a valid solution because while user data can be used to ensure that the service runs during startup, it does not provide a solution for when the service crashes after the EC2 instance has started.
The requirement is to automate recovery if the service crashes on any of the EC2 instances.
Option A: Install the Amazon CloudWatch agent on the EC2 instances. Configure the CloudWatch agent to monitor the service.Set the CloudWatch action to restart if the service health check fails .This is a valid solution
because the CloudWatch agent can be configured to monitor the service and take action (restart the service) if the health check fails .
Option C: Tag the EC2 instances. Use AWS Systems Manager State Manager to create an association that uses the AWS-RunShellScript document. Configure the association command with a script that checks if the service is
running and that starts the service if the service is not running. For targets, specify the EC2 instance tag.Schedule the association to run every 5 minutes678. This is a valid solution because AWS Systems Manager State
Manager can be used to maintain a consistent state of the EC2 instances.It can run a script to check if the service is running and start the service if it's not running678.
Option B: Tag the EC2 instances. Create an AWS Lambda function that uses AWS Systems Manager Session Manager to log in to the tagged EC2 instances and restart the service.Schedule the Lambda function to run every 5
minutes . This is not a valid solution because AWS Lambda functions are not designed to log in to EC2 instances and restart services. They are used for running serverless applications.
Option D: Update the EC2 user data that is specified in the Auto Scaling group's launch template to include a script that runs on a cron schedule every 5 minutes131415. This is not a valid solution because user data scripts are
run only during the launch of an EC2 instance. They are not designed to run on a schedule.
Option E: Update the EC2 user data that is specified in the Auto Scaling group's launch template to ensure that the service runs during startup.Redeploy all the EC2 instances in the Auto Scaling group with the updated launch
template131416. This is not a valid solution because while user data can be used to ensure that the service runs during startup, it does not provide a solution for when the service crashes after the EC2 instance has started.