Question

Difficulty: MediumDeployment Strategies and Execution

A SysOps Administrator is configuring a blue/green deployment strategy for a containerized application running on Amazon Elastic Container Service (Amazon ECS) behind an Application Load Balancer (ALB). The updates must be deployed using AWS CodeDeploy. The administrator needs to ensure that the deployment automatically rolls back if the new tasks fail to launch or fail target group health checks, or if application performance degradation (such as elevated error rates) occurs during traffic shifting. Which two configuration steps must the administrator perform to meet these requirements? (Choose two.)

  1. Update the ECS service definition to set the deployment controller type to CodeDeploy, and associate the deployment group with two target groups: one for the active traffic environment and one for the standby environment.Answer
  2. Create Amazon CloudWatch alarms that monitor application metrics, and add these alarms to the CodeDeploy deployment group's automatic rollback configuration.Answer
  3. C
    Enable the ECS deployment circuit breaker with the rollback option enabled within the ECS service definition.
  4. D
    Configure an Amazon EventBridge rule that detects a CodeDeploy deployment failure event and triggers an AWS Systems Manager (SSM) Automation workflow to redeploy the previous task definition.
  5. E
    Attach an IAM policy to the CodeDeploy service role that permits the sts:AssumeRole action but excludes the iam:PassRole permission for the ECS task execution role.

Answer

To configure the blue/green deployment for Amazon ECS using AWS CodeDeploy with automatic rollback capabilities, the administrator must configure the ECS service deployment controller type to CodeDeploy, associate the deployment group with blue and green target groups, and configure Amazon CloudWatch alarms to trigger automatic rollbacks in the CodeDeploy deployment group.
The correct options specify configuring the ECS service to use the CodeDeploy deployment controller with two target groups (blue and green) to enable the blue/green deployment pattern, and configuring CloudWatch alarms in the CodeDeploy deployment group's automatic rollback settings to monitor metrics during deployment and trigger a rollback if needed.

Step-by-Step Solution

1
Configure the deployment controller on the ECS service definition.
The ECS service is set to use the CodeDeploy deployment controller type instead of the default ECS rolling update controller.
This allows AWS CodeDeploy to manage the tasks, traffic shifting, and lifecycle hooks of the deployment.
2
Associate two target groups with the CodeDeploy deployment group.
CodeDeploy can direct traffic between the active target group (blue) and the target group running the new task version (green).
Two target groups are required in a blue/green deployment configuration to allow isolated testing and seamless traffic shifting.
3
Add CloudWatch alarms to the CodeDeploy rollback configuration.
If the metrics (like 5XX errors or response times) exceed limits, CodeDeploy detects the alarm and automatically reverts the traffic back to the original target group.
This meets the requirement to automatically roll back the deployment upon detecting application performance degradation.

Key Concept

AWS CodeDeploy manages ECS blue/green deployments by shifting traffic between two target groups and can automate rollbacks using native CloudWatch alarm integration.
Rate this question