AWS SAM reference
This section contains AWS SAM reference material. This includes AWS SAMÂ CLI reference material, like reference information on AWS SAMÂ CLI commands and additional AWS SAMÂ CLI information, like configuration, version control, and troubleshooting information. Additionally, this section includes reference information on the AWS SAM specification and the AWS SAM template, like reference information on connectors, image repositories, and deployments.
AWS SAM specification and the AWS SAM template
The AWS SAM specification is an open-source specification under the Apache 2.0 license. The current version of the AWS SAM specification is available in the AWS SAM template. AWS SAM specification comes with a simplified short-hand syntax you use to define the functions, events, APIs, configurations, and permissions of your serverless application.
You interact with AWS SAM specification through the AWS SAM application project directory, which are the folders and files that are created when you run the sam init command. This directory includes the AWS SAM template, an important file that defines your AWS resources. The AWS SAM template is an extension of a AWS CloudFormation template. For the full reference for CloudFormation templates, see Template reference in the AWS CloudFormation User Guide.
AWS SAMÂ CLI command reference
The AWS Serverless Application Model Command Line Interface (AWS SAMÂ CLI) is a command line tool that you can use with AWS SAM templates and supported third-party integrations to build and run your serverless applications.
You can use the AWS SAMÂ CLI commands to develop, test, and deploy your serverless applications to the AWS Cloud. The following are some examples of AWS SAMÂ CLI commands:
-
sam initâ If you're a first-time AWS SAMÂ CLI user, you can run thesam initcommand without any parameters to create a Hello World application. The command generates a preconfigured AWS SAM template and example application code in the language that you choose. -
sam local invokeandsam local start-apiâ Use these commands to test your application code locally, before deploying it to the AWS Cloud. -
sam logsâ Use this command to fetch logs that your Lambda Event Function generates. This can help you with testing and debugging your application after you've deployed it to the AWS Cloud. -
sam packageâ Use this command to bundle your application code and dependencies into a deployment package. You need the deployment package to upload your application to the AWS Cloud. -
sam deployâ Use this command to deploy your serverless application to the AWS Cloud. It creates the AWS resources and sets permissions and other configurations that are defined in the AWS SAM template.
For instructions about installing the AWS SAMÂ CLI, see Install the AWS SAMÂ CLI.
AWS SAM policy templates
With AWS SAM, you can choose from a list of policy templates to scope your AWS Lambda function's permissions to the resources that your application uses. For a list of available policy templates, refer to Policy template table. For general information on policy templates and AWS SAM, refer to AWS SAMÂ policy templates.