AWS SAM FAQs

General

The AWS Serverless Application Model (AWS SAM) is an open source framework for building serverless applications. It provides shorthand syntax to express functions, APIs, databases, and event source mappings. You define the application you want with just a few lines per resource and model it using YAML.

AWS SAM provides shorthand syntax to express functions, APIs, databases, and event source mappings. During deployment, SAM transforms and expands the SAM syntax into AWS CloudFormation syntax. Then, CloudFormation provisions your resources with reliable deployment capabilities.

AWS SAM and the SAM CLI are open-sourced under the Apache 2.0 license. You can contribute new features and enhancements to AWS SAM on GitHub or the AWS SAM CLI on GitHub.

There is no additional charge to use AWS SAM. You pay for the AWS resources created using SAM in the same manner as if you created them manually. You only pay for what you use, as you use it. There are no minimum fees and no required upfront commitments.

You can use AWS SAM to build serverless applications that use any runtime supported by AWS Lambda. You can also use SAM CLI to locally debug Lambda functions written in Node.js, Java, Python, and Go.

AWS SAM is available in all regions where AWS Lambda is available. To learn more, see the AWS Lambda region table.

The SAM Command Line Interface (CLI) lets you locally build, test, and debug serverless applications defined by AWS SAM templates. SAM CLI provides a Lambda-like execution environment locally and helps you catch issues upfront. 

You can install AWS SAM CLI on Linux, Mac, or Windows using pip. To get started, visit our installation documentation

Developing with AWS Sam

A SAM template file is a YAML configuration that represents the architecture of a serverless application. You use the template to declare all of the AWS resources that comprise your serverless application in one place. AWS SAM templates are an extension of AWS CloudFormation templates, so any resource that you can declare in an AWS CloudFormation template can also be declared in an AWS SAM template. Learn more

To get started with SAM, install the AWS SAM CLI and use the sam init command to generate a pre-configured AWS SAM template with sample application code. For a guided walk-through on building a serverless application using AWS SAM, try this quick start

The AWS SAM CLI is a command-line interface that supports building SAM-based applications. With the AWS SAM CLI, you can invoke Lambda functions locally, create a deployment package for your serverless application, and deploy your serverless application to the AWS Cloud.

SAM CLI supports a growing number of commands. The sam init command generates pre-configured AWS SAM templates along with example application code in the language of your choice. The sam local command supports local invocation and testing of your Lambda functions and SAM-based serverless applications by executing your function code locally in a Lambda-like execution environment. You can also use the sam local command to generate sample payloads locally, start a local endpoint to test your APIs, or automate testing of your Lambda functions. The sam package and sam deploy commands let you bundle your application code and dependencies into a “deployment package" and then deploy your serverless application to the AWS Cloud. Finally, the sam logs command enables you to fetch, tail, and filter logs for Lambda functions.