AWS SAM CLI Introduces the sam build Command

Posted on: Nov 19, 2018

You can now use the sam build command to compile deployment packages for AWS Lambda functions written in Python using the AWS Serverless Application Model (AWS SAM) Command Line Interface (CLI).

AWS SAM CLI lets you locally build, test, and debug serverless applications defined by SAM templates. Using the sam build command, you can easily create deployment artifacts that target AWS Lambda's execution environment. This enables the functions you build locally to run in a similar environment in the cloud. The sam build command iterates through the functions in your application, looks for a manifest file (such as requirements.txt) that contains dependencies, and automatically creates deployment artifacts that you can deploy to Lambda using the sam package and sam deploy commands.

If your functions depend on packages that have natively compiled programs, you can also use the sam build command with the --use-container flag. The --use-container flag compiles your functions in a Lambda-like environment locally so they are in the correct format when you deploy them to the cloud.

To get started with SAM CLI and learn how to build, test, and debug serverless applications faster, visit the SAM product page.