Q86 — AWS DOP-C02 Ch.2
Question 86 of 100 | ← Chapter 2
A DevOps engineer is building a CI/CD pipeline for a serverless application that uses AWS Lambda functions. The company wants to minimize the impact of failed deployments on customers and also wants monitoring capabilities. Which deployment strategy configuration meets these requirements?
- A. Use an AWS Serverless Application Model (AWS SAM) template to define the serverless application. Deploy the Lambda function using AWS CodeDeploy with a Canary10Percent15Minutes deployment preference type. Use Amazon CloudWatch alarms to monitor the function's health. ✓
- B. Use AWS CloudFormation to publish new stack updates and include Amazon CloudWatch alarms on all resources. Set up an AWS CodePipeline approval action for developers to verify and approve AWS CloudFormation change sets.
- C. Use AWS CloudFormation to publish a new version on each stack update and include Amazon CloudWatch alarms on all resources. During stack updates, use the RoutingConfig property of the AWS::Lambda::Alias resource to update traffic routing.
- D. Use AWS CodeBuild to add sample event payloads for testing Lambda functions. Publish a new version of the function and include Amazon CloudWatch alarms. Update the production alias to point to the new version. Configure rollback to occur when alarms are in ALARM state.
Correct Answer: A. Use an AWS Serverless Application Model (AWS SAM) template to define the serverless application. Deploy the Lambda function using AWS CodeDeploy with a Canary10Percent15Minutes deployment preference type. Use Amazon CloudWatch alarms to monitor the function's health.
Explanation
The AWS Serverless Application Model (SAM) enables declarative definition of Lambda functions and related resources via templates, simplifying deployment. AWS CodeDeploy's Canary deployment type (e.g., 10% traffic for 15 minutes) gradually shifts traffic, minimizing blast radius of failures. Amazon CloudWatch alarms provide real-time health monitoring to detect issues early. Option B introduces manual approval delays and lacks progressive traffic shifting. Option C does not explicitly implement staged traffic shifting and thus fails to control risk effectively. Option D lacks automated phased deployment and relies on reactive rollback rather than proactive prevention. AWS documentation recommends using CodeDeploy's Canary or Linear deployment strategies combined with CloudWatch alarms for safe, reliable Lambda deployments.