Tutorial: Deploy an updated Lambda function with CodeDeploy and the Amazon Serverless Application Model - Amazon CodeDeploy
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Tutorial: Deploy an updated Lambda function with CodeDeploy and the Amazon Serverless Application Model

Amazon SAM is an open-source framework for building serverless applications. It transforms and expands YAML syntax in a Amazon SAM template into Amazon CloudFormation syntax to build serverless applications, such as a Lambda function. For more information, see What is the Amazon Serverless Application Model?

In this tutorial, you use Amazon SAM to create a solution that does the following:

  • Creates your Lambda function.

  • Creates your CodeDeploy application and deployment group.

  • Creates two Lambda functions that execute deployment validation tests during CodeDeploy lifecycle hooks.

  • Detects when your Lambda function is updated. The updating of the Lambda function triggers a deployment by CodeDeploy that incrementally shifts production traffic from the original version of your Lambda function to the updated version.

Note

This tutorial requires you to create resources that might result in charges to your Amazon account. These include possible charges for CodeDeploy, Amazon CloudWatch, and Amazon Lambda. For more information, see CodeDeploy pricing, Amazon CloudWatch pricing, and Amazon Lambda pricing.