Which solution will satisfy these requirements?
Use an AWS CloudFormation template with a retention policy for the ALB set to 1 hour. Update the Amazon Route 53 record to reflect the new ALB.
Use two AWS Elastic Beanstalk environments to perform a blue/green deployment from the original environment to the new one. Create an application version lifecycle policy to terminate the original environment in 1 hour.
Use AWS CodeDeploy with a deployment group configured with a blue/green deployment configuration. Select the option Terminate the original instances in the deployment group with a waiting period of 1 hour.
Use AWS Elastic Beanstalk with the configuration set to Immutable. Create an .ebextension using the Resources key that sets the deletion policy of the ALB to 1 hour, and deploy the application.
Explanations:
AWS CloudFormation does not directly support blue/green deployment strategies for EC2 instances behind an ALB. Also, the retention policy for an ALB does not handle automatic scaling or traffic transition based on instance fleet changes.
AWS Elastic Beanstalk supports blue/green deployments, but this involves using two separate environments. The requirement specifies using EC2 Auto Scaling groups and ALBs, not Elastic Beanstalk environments.
AWS CodeDeploy supports blue/green deployment configurations and can be set up to launch a second fleet, transition traffic, and terminate the original fleet after a specified waiting period. This satisfies all the requirements.
The Immutable deployment strategy in Elastic Beanstalk involves creating new instances and gradually replacing the old ones. However, this does not address the requirement of terminating the original fleet after 1 hour or handling traffic transition in the exact manner required.