Posted On: Jul 21, 2020
The AWS Serverless Application Model Command Line Interface (SAM CLI) is now generally available. SAM CLI is a deployment toolkit that also allows you to locally build, test, and debug serverless applications. SAM CLI v.1.0.0 is a stable version recommended for building production serverless applications.
SAM CLI enables you to easily build serverless applications using a number of commands, including sam init, sam build, and sam deploy. Using sam build, you can compile your application code and dependencies. To compile Custom AWS Lambda runtimes and AWS Lambda Layers, you can include the BuildMethod property in your SAM template under the function or layer resource. The BuildMethod is either an AWS Lambda runtime or Makefile, which defines a set of tasks to be executed.
You can use sam build to compile a single layer, a single function resource (compiles both function code and layers) or compile the entire application. SAM CLI also enables you to locally test and debug your application before building it using sam local invoke. You can then deploy your application using sam deploy --guided.
You can use SAM CLI with IDEs like AWS Cloud9 and AWS Toolkits for PyCharm, IntelliJ, and Visual Studio Code. To provide feedback or make pull requests, visit SAM CLI on GitHub. SAM CLI is available in all Regions where AWS Lambda is available. To see all supported Regions, visit the AWS Region Table. To get started, install the AWS SAM CLI.