Which combination of steps will meet these requirements?
(Choose three.)
Create an AWS CloudFormation template for the application. Define each Lambda function in the template by using the AWS::Lambda::Function resource type. In the template, include a version for the Lambda function by using the AWS::Lambda::Version resource type. Declare the CodeSha256 property. Configure an AWS::Lambda::Alias resource that references the latest version of the Lambda function.
Create an AWS Serverless Application Model (AWS SAM) template for the application. Define each Lambda function in the template by using the AWS::Serverless::Function resource type. For each function, include configurations for the AutoPublishAlias property and the DeploymentPreference property. Configure the deployment configuration type to LambdaCanary10Percent10Minutes.
Create an AWS CodeCommit repository. Create an AWS CodePipeline pipeline. Use the CodeCommit repository in a new source stage that starts the pipeline. Create an AWS CodeBuild project to deploy the AWS Serverless Application Model (AWS SAM) template. Upload the template and source code to the CodeCommit repository. In the CodeCommit repository, create a buildspec.yml file that includes the commands to build and deploy the SAM application.
Create an AWS CodeCommit repository. Create an AWS CodePipeline pipeline. Use the CodeCommit repository in a new source stage that starts the pipeline. Create an AWS CodeDeploy deployment group that is configured for canary deployments with a DeploymentPreference type of Canary10Percent10Minutes. Upload the AWS CloudFormation template and source code to the CodeCommit repository. In the CodeCommit repository, create an appspec.yml file that includes the commands to deploy the CloudFormation template.
Create an Amazon CloudWatch composite alarm for all the Lambda functions. Configure an evaluation period and dimensions for Lambda. Configure the alarm to enter the ALARM state if any errors are detected or if there is insufficient data.
Create an Amazon CloudWatch alarm for each Lambda function. Configure the alarms to enter the ALARM state if any errors are detected. Configure an evaluation period, dimensions for each Lambda function and version, and the namespace as AWS/Lambda on the Errors metric.
Explanations:
The AWS CloudFormation template does not natively support canary deployments or automated rollback for Lambda functions. It lacks the necessary properties likeDeploymentPreferenceandAutoPublishAliasfor canary deployment configuration.
The AWS SAM template supports canary deployments with theDeploymentPreferenceproperty, which can be configured for a canary deployment such asLambdaCanary10Percent10Minutes. It also handles automated rollback and versioning for Lambda functions.
Using AWS CodePipeline with a CodeCommit repository and AWS CodeBuild allows for a CI/CD pipeline to automate the deployment of the SAM application. The buildspec.yml file will define the steps to deploy the application after it’s built, which aligns with the requirements.
AWS CodeDeploy does not natively support canary deployments for Lambda functions when using CloudFormation templates. The canary deployment functionality withDeploymentPreferenceis specific to AWS SAM templates.
A CloudWatch composite alarm is not ideal for automated rollback, as it’s not designed to trigger the rollback process automatically. It’s used for aggregating multiple alarms but doesn’t directly handle canary deployment failures.
A CloudWatch alarm for each Lambda function, configured to monitor theErrorsmetric, is necessary for detecting failures in canary deployments. This allows for automated rollback when failures are detected in the Lambda versions being deployed.