An enterprise is designing a deployment pipeline for a critical containerized microservice running on Amazon ECS with AWS Fargate behind an Application Load Balancer (ALB). The infrastructure and deployment pipelines must be managed as infrastructure as code (IaC) using AWS CloudFormation. The enterprise has established the following requirements for deployment strategy design:
- Deployments must be fully automated and must not cause any application downtime.
- A new version of the microservice must be tested with a subset of live traffic, routing exactly of the production traffic to the new version for a duration of minutes before shifting the remaining of traffic.
- The deployment must automatically roll back immediately if the new version displays any degradation in performance, specifically measured by an increase in response codes.
Which two configuration steps should the solutions architect combine to meet these requirements?
- Configure the AWS CloudFormation template to use the `AWS::CodeDeploy::BlueGreen` transform, defining an Amazon ECS service that references an AWS CodeDeploy deployment group configured with the `CodeDeployDefault.ECSCanary10Percent15Minutes` deployment configuration.Answer
- Create an Amazon CloudWatch alarm to monitor the `HTTPCode_Target_5XX_Count` metric of the replacement target group on the Application Load Balancer, and configure the CodeDeploy deployment group to perform an automatic rollback when this alarm enters the `ALARM` state.Answer
- CEnable the Amazon ECS deployment circuit breaker on the service definition in the CloudFormation template, and configure the `rollback` parameter to true to automatically roll back the service if container health checks or error counts exceed the threshold.
- DConfigure an `UpdatePolicy` with `AutoScalingRollingUpdate` on the Amazon ECS service resource in the CloudFormation template to shift traffic progressively in increments of every minutes.
- ECreate two Route weighted alias records pointing to separate blue and green Application Load Balancers, and implement an AWS Lambda function triggered by a cron schedule to increment the weight of the green record by every minutes.