AWS Certified Solutions Architect Professional SAP-C02 Practice Question
An e-commerce company needs to add a CI/CD pipeline for a business-critical AWS Lambda function that processes real-time transactions. The pipeline must 1) deploy new versions with zero downtime, 2) initially route only 10 percent of production traffic to the new version and automatically shift the remaining traffic 15 minutes later, 3) roll back automatically if the function's 5xx error rate exceeds 1 percent during the first traffic-shifting window, and 4) minimize custom code and operational overhead. Which solution meets these requirements?
Create an AWS CodePipeline deploy stage that uses AWS CodeDeploy with the predefined deployment configuration CodeDeployDefault.LambdaCanary10Percent15Minutes. Associate a CloudWatch alarm that monitors the Lambda Errors metric and enable automatic rollback on alarm breach.
Use AWS CloudFormation to create a change set that updates the Lambda function version, configure the stack to roll back on failure, and add a 15-minute creation policy before completion.
Configure an Amazon EventBridge rule to invoke an AWS Step Functions state machine that updates the Lambda alias weights in 10 percent increments and monitors CloudWatch metrics to trigger a custom rollback Lambda function.
Deploy the Lambda function with AWS Elastic Beanstalk using a rolling deployment policy and configure a CloudWatch alarm to initiate rollback if the 5xx error rate exceeds 1 percent.
AWS CodeDeploy provides predefined canary deployment configurations for Lambda, including CodeDeployDefault.LambdaCanary10Percent15Minutes, which routes 10 percent of traffic to the new version and shifts the rest after 15 minutes. When the deploy stage in an AWS CodePipeline uses this deployment configuration and a CloudWatch alarm that monitors the Lambda Errors metric, CodeDeploy can automatically stop the deployment and roll back to the previous version if the alarm breaches. This satisfies zero-downtime releases, incremental traffic shifting, automated rollback, and minimal custom code.
A CloudFormation change set cannot perform incremental traffic shifting for Lambda; stack rollback only triggers on stack-level failures, not application metrics. A custom EventBridge/Step Functions workflow could implement traffic shifting and rollback but requires significant custom code and maintenance. Elastic Beanstalk rolling policies do not apply to Lambda functions and cannot satisfy the traffic-shifting requirements.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is AWS CodeDeploy, and how does it handle canary deployments for Lambda?
Open an interactive chat with Bash
What is a CloudWatch alarm, and how is it used in deployment rollbacks?
Open an interactive chat with Bash
Why was CodeDeploy chosen over alternatives like CloudFormation or Step Functions in this scenario?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Design for New Solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access