What is the AWS Serverless Application Model (AWS SAM)?
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.
How does AWS SAM work?
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.
How much does AWS SAM cost to use?
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.
What is AWS SAM CLI?
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.
DEVELOPING WITH AWS SAM
What is a SAM template?
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
What can I do with AWS SAM CLI?
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.