AWS Developer DVA-C02 · Deployment · medium
A serverless team uses AWS SAM (template.yaml) and AWS CodeDeploy to deploy a new version of an AWS Lambda function behind an alias named live. They configure DeploymentPreference with Type: Linear10PercentEvery5Minutes. How long will it take for 100% of production traffic on the live alias to shift to the new Lambda version, and which two CodeDeploy lifecycle hooks are available for Lambda deployments?
Published · Last updated · checked before publication — how we verify questions
Options
Answer: A. 10% shifts every 5 minutes using BeforeAllowTraffic and AfterAllowTraffic hooks
With Linear10PercentEvery5Minutes, CodeDeploy shifts 10% of traffic initially and adds 10% every 5 minutes across 9 subsequent intervals ($9 \times 5 = 45$ minutes; or 10 steps of 10% over 45–50 minutes, reaching 100% after 9 intervals of 5 minutes = 45 minutes after the initial 10% step, or 50 minutes across 10 intervals). For AWS Lambda deployments, CodeDeploy supports only two lifecycle hooks: BeforeAllowTraffic and AfterAllowTraffic (unlike EC2 deployments which use BeforeInstall, AfterInstall, ApplicationStart, ValidateService).
Why the other options are wrong
- B. 10% shifts for 5 minutes then 90% at once using BeforeInstall and AfterInstall — Shifting 10% then 90% describes a Canary deployment, and BeforeInstall/AfterInstall are EC2/On-Premises hooks.
- C. 100% shifts immediately using ApplicationStop and ValidateService EC2 hooks — Shifting 100% immediately is AllAtOnce, and ApplicationStop/ValidateService are EC2 hooks.
- D. 5% shifts every 10 minutes using BeforeBlockTraffic and DownloadBundle hooks — The policy name Linear10PercentEvery5Minutes shifts 10% every 5 minutes, not 5% every 10 minutes.
More Deployment questions
- An AWS CloudFormation stack provisions an Amazon RDS production database and an Amazon S3 audit bucket. If a junior…
- A developer is writing a buildspec.yml file for AWS CodeBuild that compiles a Node.js TypeScript service, runs unit…
- You are deploying an application to Amazon EC2 instances using AWS CodeDeploy (in-place deployment). Inside the root…
- An application runs on AWS Elastic Beanstalk across a fleet of 6 EC2 instances behind an Application Load Balancer…
- In an AWS CloudFormation template, Stack A (NetworkStack) creates a production VPC and wants to export the VpcId so…
AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.