Soru

Zorluk: OrtaDeployment Strategies

A developer is configuring a blue/green deployment for an Amazon Elastic Container Service (Amazon ECS) service using AWS CodeDeploy and an Application Load Balancer (ALB). The service runs 44 tasks under normal operation. The developer must run automated integration tests against the new version of the application (the replacement task set) in the production environment before routing any live production traffic to it.

Which configuration should the developer implement to meet these requirements?

  1. Configure a test listener on the ALB that points to the replacement target group, specify this listener in the CodeDeploy deployment group, and run the integration tests during the AfterAllowTestTraffic lifecycle hook.Cevap
  2. B
    Configure the ALB production listener to route 0%0\% of live traffic to the replacement target group, and execute the integration tests using the BeforeInstall lifecycle hook in the appspec.yaml file.
  3. C
    Add a path-based routing rule to the ALB production listener to route traffic with a /test prefix to the replacement target group, and run the integration tests using the BeforeAllowTraffic lifecycle hook.
  4. D
    Deploy a separate, temporary ALB for the replacement task set, run the integration tests against this ALB, and then update the ECS service configuration to point to the new ALB using the AWS Command Line Interface (AWS CLI).

Cevap

Configure a test listener on the ALB that points to the replacement target group, specify this listener in the CodeDeploy deployment group, and run the integration tests during the AfterAllowTestTraffic lifecycle hook.
The correct configuration utilizes a dedicated test listener on the Application Load Balancer (ALB) to route traffic specifically to the replacement target group hosting the Green task set. By specifying this test listener in AWS CodeDeploy, developers can target the new deployment for testing. The AfterAllowTestTraffic lifecycle hook runs immediately after the test listener starts directing traffic to the replacement task set, providing the ideal phase to execute automated validation tests before any live production traffic is shifted.

Adım Adım Çözüm

1
Identify the mechanism for routing test traffic in AWS CodeDeploy ECS blue/green deployments.
A dedicated test listener must be configured on the Application Load Balancer to direct traffic to the replacement (Green) target group.
This isolates test traffic from production traffic, preventing real users from hitting the unverified deployment.
2
Determine the appropriate lifecycle hook in the AppSpec file to execute the automated integration tests.
The AfterAllowTestTraffic hook is selected.
This hook runs after the test listener starts directing traffic to the replacement task set, allowing test traffic to reach the new version for validation.
3
Verify that the selected hook and listener combination meets all constraints without exposing the new version to production traffic.
The configuration successfully validates the Green task set using the test listener, and only starts shifting production traffic after tests complete successfully.
This satisfies the zero-downtime and pre-traffic validation requirements.

Anahtar Kavram

ECS Blue/Green Deployment Validation with CodeDeploy
Bu soruyu puanla