AWS Certified Solutions Architect – Professional — Question 855

A company has a serverless application comprised of Amazon CloudFront, Amazon API Gateway, and AWS Lambda functions. The current deployment process of the application code is to create a new version number of the Lambda function and run an AWS CLI script to update. If the new function version has errors, another CLI script reverts by deploying the previous working version of the function. The company would like to decrease the time to deploy new versions of the application logic provided by the Lambda functions, and also reduce the time to detect and revert when errors are identified.
How can this be accomplished?

Answer options

Correct answer: B

Explanation

AWS SAM integrated with AWS CodeDeploy is the industry standard for managing safe, automated serverless deployments using gradual traffic shifting (such as canary or linear deployments). It allows the use of pre-traffic and post-traffic Lambda hooks to execute tests and automatically rolls back the deployment if configured Amazon CloudWatch alarms are triggered. Other solutions involving custom CLI scripting or manual CloudFront origin swapping are highly complex, slower, and do not offer the same robust, native automation.