Soru

Zorluk: ZorDeployment Strategy Design

An enterprise is designing a serverless deployment pipeline for a critical payment gateway service. The service is built using AWS Lambda and Amazon API Gateway, and it persists transactions in an Amazon DynamoDB table. The deployment strategy must satisfy the following constraints:

* Deployments must be fully automated with zero downtime.
* Traffic must shift gradually: 10%10\% of the traffic must route to the new version of the Lambda function for a 2020-minute evaluation period. If no issues are detected, the remaining 90%90\% must shift immediately.
* If the API Gateway 5xx5\text{xx} error rate or the Lambda function error rate exceeds 1%1\% during the evaluation period, the deployment must automatically roll back within minutes.
* The DynamoDB schema updates must not disrupt the active or deploying versions of the Lambda function.

Which two actions should the Solutions Architect take to implement this deployment strategy? (Select two.)

  1. Configure the AWS CodeDeploy deployment group to use a custom deployment configuration on the Lambda compute platform, specifying a canary traffic shifting type with a 10%10\% traffic percentage and a 2020-minute evaluation time.Cevap
  2. Configure the Amazon API Gateway integration to point to a specific Lambda function alias, and associate CloudWatch alarms monitoring Lambda errors and API Gateway 5xx5\text{xx} errors as rollback triggers in the AWS CodeDeploy deployment group.Cevap
  3. C
    Configure the Amazon API Gateway integration to point to the Lambda function's LATEST version, and use API Gateway stage canary deployment settings to route 10%10\% of the traffic to a new deployment stage for a 2020-minute evaluation.
  4. D
    Configure AWS CodePipeline to invoke an AWS Step Functions state machine that loops for 2020 minutes, using the AWS SDK to incrementally update the traffic weight of the API Gateway stage variable mapping to the LATEST version.
  5. E
    Deploy an Application Load Balancer (ALB) to target two separate target groups, each referencing a different version of the Lambda function, and use AWS CodeDeploy with the EC2 compute platform to manage weight shifting between target groups.

Cevap

Configure the AWS CodeDeploy deployment group to use a custom deployment configuration on the Lambda compute platform, specifying a canary traffic shifting type with a 10% traffic percentage and a 20-minute evaluation time. Also, configure the Amazon API Gateway integration to point to a specific Lambda function alias, and associate CloudWatch alarms monitoring Lambda errors and API Gateway 5xx errors as rollback triggers in the AWS CodeDeploy deployment group.
To achieve a custom 20-minute canary deployment with automated rollbacks for an API Gateway and Lambda application, the Solutions Architect must use AWS CodeDeploy. API Gateway must point to a specific Lambda alias because CodeDeploy manages traffic shifting at the alias level. Because there is no default 20-minute canary deployment configuration in CodeDeploy, a custom deployment configuration on the Lambda compute platform must be created. CloudWatch alarms monitoring Lambda errors and API Gateway 5xx errors must be attached to the CodeDeploy deployment group as rollback triggers to automate the rollback process if thresholds are crossed.

Adım Adım Çözüm

1
Select the correct integration target for API Gateway to support traffic shifting.
API Gateway must be integrated with a Lambda function alias rather than the mutable LATEST reference, allowing AWS CodeDeploy to control the traffic distribution between the old and new versions.
Traffic routing weights can only be applied to Lambda aliases, and CodeDeploy relies on these aliases to shift traffic during deployment.
2
Define a deployment configuration that meets the custom shifting window.
Since AWS CodeDeploy does not provide a pre-defined 20-minute canary configuration, a custom deployment configuration must be created specifying a canary type with 10% shifted for 20 minutes.
This directly meets the business requirement of a 20-minute canary evaluation phase before routing the remaining traffic.
3
Configure the monitoring and rollback mechanisms.
Attach CloudWatch alarms that monitor API Gateway 5xx errors and Lambda execution errors to the CodeDeploy deployment group's rollback triggers.
This guarantees that if the error rates exceed the defined 1% threshold, CodeDeploy will automatically roll back the deployment and restore all traffic to the previous version immediately.

Anahtar Kavram

AWS Lambda deployment traffic shifting using CodeDeploy and Lambda aliases with automated CloudWatch rollbacks.
Bu soruyu puanla