A company is deploying a containerized microservice to Amazon ECS on AWS Fargate. The deployment pipeline is managed by AWS CodePipeline and AWS CodeDeploy using an Application Load Balancer. The company's deployment policy requires that exactly of production traffic be redirected to the new task set during the initial deployment phase. The new version must be evaluated for , and if any Amazon CloudWatch alarms are triggered during this window, the deployment must automatically roll back. If no alarms are triggered, all traffic must be routed to the new version. Which strategy should the Solutions Architect implement to meet these requirements with the least operational overhead?
- Create a custom CodeDeploy deployment configuration using a TimeBasedCanary traffic routing configuration with a canary percentage of and a canary interval of . Associate this configuration with the CodeDeploy deployment group.Answer
- BConfigure the CodeDeploy deployment group to use the predefined CodeDeployDefault.ECSCanary15Percent20Minutes deployment configuration.
- CConfigure Amazon Route 53 weighted routing records to direct of DNS queries to a new ECS service running the replacement task set. Use an AWS Lambda function triggered by an Amazon EventBridge scheduler rule to update the weights after .
- DConfigure the Application Load Balancer listener rule with weighted target groups, routing of traffic to the target group containing the new task set. Use an AWS Step Functions state machine to monitor CloudWatch alarms for and update the target group weights.
Answer
Create a custom CodeDeploy deployment configuration using a TimeBasedCanary traffic routing configuration with a canary percentage of and a canary interval of . Associate this configuration with the CodeDeploy deployment group.
The correct strategy is to create a custom CodeDeploy deployment configuration. AWS CodeDeploy natively supports ECS blue/green deployments where traffic is shifted between target groups. While AWS provides several predefined configurations (e.g., Canary10Percent5Minutes, Canary10Percent15Minutes), it also allows the creation of custom deployment configurations with arbitrary values for the canary percentage and interval. This matches the requirement of for with minimal operational overhead.
Step-by-Step Solution
Key Concept
AWS CodeDeploy supports custom deployment configurations for Amazon ECS, allowing architects to define specific Canary or Linear traffic routing parameters when predefined defaults do not meet business requirements.