Question

Difficulty: Very hardDeployment Strategy Design

A financial services company is designing a deployment pipeline for a high-volume payment processing application. The application runs as an Amazon ECS service on AWS Fargate behind an Application Load Balancer (ALB) and connects to an Amazon Aurora PostgreSQL Serverless v2 database cluster. The deployment process must meet the following requirements:

1. The update must be rolled out with zero downtime.
2. Initial deployment validation must route exactly 10%10\% of live traffic to the new version, with the remaining 90%90\% routed only after the new version remains stable for 1515 minutes.
3. If the HTTP 5xx error rate exceeds 0.05%0.05\% during the validation period, the deployment must immediately and automatically roll back.
4. Database schema updates must be applied and verified before any client traffic is routed to the new tasks, without impacting the currently running tasks.

Which two actions should a Solutions Architect take to satisfy these requirements? (Select two.)

  1. Configure an AWS CodeDeploy deployment group for the ECS service using the ECSCanary10Percent15Minutes traffic-shifting configuration, and configure the deployment group to monitor a CloudWatch alarm for the ALB HTTP 5xx metric to trigger automatic rollback.Answer
  2. Design the database schema updates using the expand-and-contract pattern, and execute the migration scripts via a dedicated AWS CodeBuild step in the CI/CD pipeline prior to starting the ECS CodeDeploy deployment.Answer
  3. C
    Configure the ECS service to use the ECS rolling update deployment type with minimumHealthyPercent set to 100%100\% and maximumPercent set to 200%200\%, and configure a CloudWatch alarm on the ALB HTTP 5xx metric to trigger an automatic rollback of the service update.
  4. D
    Configure an AWS CodeDeploy deployment group for the ECS service using the ECSLinear10PercentEvery15Minutes traffic-shifting configuration, and include the database schema migration script in the ECS task definition's container entrypoint script.
  5. E
    Configure an AWS CodeDeploy deployment group for the ECS service using the ECSAllAtOnce traffic-shifting configuration, and execute the database schema migrations via a Lambda function triggered by the AfterAllowTraffic lifecycle hook.

Answer

The correct strategy is to configure an AWS CodeDeploy deployment group using the canary deployment configuration with automated CloudWatch rollbacks, while executing backward-compatible database migrations in the CI/CD pipeline prior to the deployment.
The correct strategy uses the CodeDeploy canary deployment configuration to handle the precise traffic shifting requirement, combined with a CloudWatch alarm on Application Load Balancer metrics for automatic rollback. For the database migrations, using the expand-and-contract pattern in a separate CI/CD pipeline step (such as AWS CodeBuild) ensures the database schema remains backward-compatible with the active version, preventing downtime and avoiding concurrent migration execution issues.

Step-by-Step Solution

1
Select the traffic-shifting model that routes 10%10\% of traffic to the replacement task set and then shifts the remaining 9090\\% after a 1515-minute validation period.
The ECSCanary10Percent15Minutes deployment configuration is identified as the matching AWS-native configuration.
This satisfies the requirement to shift exactly 10%10\% of live traffic initially and transition the rest after 1515 minutes.
2
Configure automated rollback based on the HTTP 5xx error rate.
A CloudWatch alarm is created for the Application Load Balancer's HTTPCode_Target_5XX_Count metric with a 11-minute evaluation window, and associated with the CodeDeploy deployment group.
This ensures that if the error rate exceeds the 0.05%0.05\% threshold during the canary phase, CodeDeploy automatically halts the deployment and rolls back immediately.
3
Determine the appropriate time and mechanism for database migrations to prevent lock contention and downtime.
The migrations are executed as a separate AWS CodeBuild step in the pipeline before CodeDeploy starts, using a backward-compatible (expand-and-contract) database schema design.
Executing the migration in the pipeline prevents container startup race conditions, and using the expand-and-contract pattern ensures the currently running tasks (which still receive 100100\\% of traffic initially) are not impacted by the database changes.

Key Concept

AWS CodeDeploy Canary configuration and backward-compatible database migration patterns in blue/green deployments.
Rate this question