Which solution will meet these requirements?
Use AWS CloudFormation to create an AWS Step Functions state machine and Auto Scaling lifecycle hooks to move to one instance at a time into a wait state. Use AWS Systems Manager automation to deploy the update to each instance and move it back into the Auto Scaling group using the heartbeat timeout.
Use AWS CodeDeploy with Amazon EC2 Auto Scaling. Configure an alarm tied to the CPU utilization metric. Use the CodeDeployDefault.OneAtAtime configuration as a deployment strategy. Configure automatic rollbacks within the deployment group to roll back the deployment if the alarm thresholds are breached.
Use AWS Elastic Beanstalk for load balancing and AWS Auto Scaling. Configure an alarm tied to the CPU utilization metric. Configure rolling deployments with a fixed batch size of one instance. Enable enhanced health to monitor the status of the deployment and roll back based on the alarm previously created.
Use AWS Systems Manager to perform a blue/green deployment with Amazon EC2 Auto Scaling. Configure an alarm tied to the CPU utilization metric. Deploy updates one at a time. Configure automatic rollbacks within the Auto Scaling group to roll back the deployment if the alarm thresholds are breached.
Explanations:
AWS CloudFormation and Step Functions with lifecycle hooks are not ideal for deployment automation in this case. While it could ensure one instance is deployed at a time, it doesn’t directly manage automatic rollbacks based on CPU utilization or have built-in deployment strategies like CodeDeploy.
AWS CodeDeploy with Amazon EC2 Auto Scaling provides a OneAtATime deployment strategy that ensures only one instance is deployed at a time. It integrates with CloudWatch alarms to monitor CPU utilization and can automatically roll back if the CPU utilization exceeds the threshold, fulfilling all requirements.
AWS Elastic Beanstalk is a higher-level service that abstracts many details and does not give granular control over deployment processes. While it supports rolling deployments, it is not as flexible as CodeDeploy for monitoring specific metrics like CPU utilization and doesn’t natively support automatic rollback in response to such metrics.
AWS Systems Manager blue/green deployments typically involve entire environment shifts, not one instance at a time. It also does not have the specific built-in mechanisms for monitoring and rolling back based on CPU utilization, making it less suitable for the scenario.