Which deploy stage configuration will meet these requirements?
Use an AWS Serverless Application Model (AWS SAM) template to define the serverless application. Use AWS CodeDeploy to deploy the Lambda functions with the Canary10Percent15Minutes Deployment Preference Type. Use Amazon CloudWatch alarms to monitor the health of the functions.
Use AWS CloudFormation to publish a new stack update, and include Amazon CloudWatch alarms on all resources. Set up an AWS CodePipeline approval action for a developer to verify and approve the AWS CloudFormation change set.
Use AWS CloudFormation to publish a new version on every stack update, and include Amazon CloudWatch alarms on all resources. Use the RoutingConfig property of the AWS::Lambda::Alias resource to update the traffic routing during the stack update.
Use AWS CodeBuild to add sample event payloads for testing to the Lambda functions. Publish a new version of the functions, and include Amazon CloudWatch alarms. Update the production alias to point to the new version. Configure rollbacks to occur when an alarm is in the ALARM state.
Explanations:
Using AWS SAM for defining the application allows for streamlined deployment. AWS CodeDeploy with a Canary deployment strategy minimizes customer impact by routing a small percentage of traffic to the new version initially, while Amazon CloudWatch alarms can monitor the function’s health during this staged rollout.
While AWS CloudFormation can manage stack updates and alarms can monitor resources, an approval action does not reduce the customer impact during deployment and lacks a gradual rollout mechanism, which is critical for minimizing issues in serverless environments.
Although this option uses AWS CloudFormation and includes monitoring, it does not implement a gradual deployment strategy, which is essential to reducing customer impact. Updating traffic routing in a single stack update does not provide the safety net of testing with live traffic before full deployment.
This option focuses on testing with sample event payloads and updating the production alias directly after a version is published, which does not provide a mechanism for gradual deployment and monitoring the success of the deployment before full traffic shift. It also lacks a rollback strategy tied to an alarm state during a staged rollout.