Soru

Zorluk: OrtaDeployment Strategies

A developer is configuring a blue/green deployment for a containerized application on Amazon ECS using AWS CodeDeploy. The deployment configuration utilizes an Application Load Balancer with two target groups and a test listener. The developer wants to run automated integration tests against the replacement task set via the test listener to validate the new version of the application before shifting any production traffic.

Which AppSpec lifecycle hook should the developer use to run these integration tests?

  1. A
    ValidateService
  2. AfterAllowTestTrafficCevap
  3. C
    BeforeAllowTraffic
  4. D
    AfterInstall

Cevap

AfterAllowTestTraffic
The correct answer is the hook named AfterAllowTestTraffic. During an ECS blue/green deployment, AWS CodeDeploy executes hooks in a specific order: BeforeInstall, AfterInstall, AfterAllowTestTraffic, BeforeAllowTraffic, and AfterAllowTraffic. The test listener begins routing traffic to the replacement task set just before AfterAllowTestTraffic runs. This is the only point where the application is reachable via the test listener for validation tests before the production listener is updated to point to the replacement task set.

Adım Adım Çözüm

1
Analyze the deployment architecture and requirements.
The target is Amazon ECS using AWS CodeDeploy for blue/green deployment. The requirement is to run automated integration tests against the replacement (new) task set using the test listener before shifting production traffic.
Understanding the target platform and specific validation workflow constraints is essential for selecting the correct lifecycle hook.
2
Map the sequence of AWS CodeDeploy ECS lifecycle hooks.
The ECS lifecycle hooks run in the following order: BeforeInstall -> AfterInstall -> AfterAllowTestTraffic -> BeforeAllowTraffic -> AfterAllowTraffic. The test listener starts routing traffic to the replacement tasks just before the AfterAllowTestTraffic hook runs.
Identifying the execution order of ECS hooks allows us to determine when the replacement tasks are reachable via the test listener.
3
Select the hook that matches the requirement of using the test listener for validation.
The AfterAllowTestTraffic hook is executed after the test listener begins routing traffic to the replacement task set. This allows running tests against the test listener endpoint.
Running tests at any other stage would fail because the replacement task set would not yet be reachable via the test listener.

Anahtar Kavram

AWS CodeDeploy ECS Blue/Green Lifecycle Hooks
Bu soruyu puanla