Soru

Zorluk: OrtaDeployment Strategy Design

A company is designing a deployment pipeline using AWS CloudFormation to update a stateless API application running on Amazon EC2 instances. The instances are managed by an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The update process must guarantee zero downtime. The new version of the API must be fully validated using synthetic test traffic in the production environment before receiving any live production traffic. If validation fails, the deployment must immediately revert to the previous version without configuration changes or downtime. Which deployment strategy should the solutions architect recommend to meet these requirements?

  1. Configure a blue/green deployment strategy by defining a second target group and a second Auto Scaling group in the CloudFormation template. Use an ALB test listener to route synthetic test traffic to the new target group for validation. Once validation succeeds, update the ALB production listener default action to point to the new target group, and then scale down the old Auto Scaling group.Cevap
  2. B
    Configure the AutoScalingRollingUpdate update policy in the CloudFormation template, setting the MinInstancesInService parameter equal to the Auto Scaling group's desired capacity. Implement the cfn-signal helper script in the instance user data to notify CloudFormation of a successful bootstrap before updating the remaining instances.
  3. C
    Configure AWS CodeDeploy to manage a blue/green deployment using the existing Auto Scaling group. Define a deployment configuration that utilizes the AfterAllowTestTraffic lifecycle event hook to run validation tests on the new instances before CodeDeploy switches the production traffic to the new Auto Scaling group.
  4. D
    Create a nested CloudFormation stack containing the Auto Scaling group with the UpdateReplacePolicy attribute set to Retain. Deploy the new stack version alongside the old version, manually modify the ALB listener rules to point to the new Auto Scaling group's target group after validation, and then delete the old stack.

Cevap

Configure a blue/green deployment strategy by defining a second target group and a second Auto Scaling group in the CloudFormation template. Use an ALB test listener to route synthetic test traffic to the new target group for validation. Once validation succeeds, update the ALB production listener default action to point to the new target group, and then scale down the old Auto Scaling group.
Implementing a blue/green deployment by creating a secondary target group and Auto Scaling group via AWS CloudFormation fulfills all criteria. Using an Application Load Balancer (ALB) test listener enables validation with synthetic traffic on the new instances without affecting live users. Updating the production listener default action to point to the green target group provides an instantaneous, zero-downtime cutover that is easily reversible by pointing back to the blue target group if issues arise.

Adım Adım Çözüm

1
Define target groups and Auto Scaling groups.
Two distinct target groups (Blue and Green) and two Auto Scaling groups are declared in the CloudFormation template, allowing isolated environments to run concurrently.
Separating environments is necessary to validate the new application version in production without impacting the live version.
2
Configure ALB test and production listeners.
A production listener routes user traffic to the active version, while a test listener routes QA/synthetic traffic to the new version.
This allows tests to run against the new code in the actual production environment without exposing live users to unvalidated code.
3
Perform the traffic swap and clean up.
Once validated, update the production listener's default action to point to the new target group. The old Auto Scaling group is then scaled down to optimize costs.
Swapping listener targets provides an instantaneous cutover with zero downtime and a simple rollback path if post-deployment anomalies occur.

Anahtar Kavram

Designing automated, zero-downtime blue/green deployment strategies using AWS CloudFormation and Application Load Balancer target group swapping.
Bu soruyu puanla