The Amazon SAM project and Amazon SAM template - Amazon Serverless Application Model
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

The Amazon SAM project and Amazon SAM template

After you run the sam init command and complete its subsequent workflow, Amazon SAM creates your application project directory, which is your Amazon SAM project. You define your serverless application by adding code to your Amazon SAM project. While your Amazon SAM project consists of a set of files and folders, the file you primarily work with is your Amazon SAM template (named template.yaml). In this template, you write the code to express resources, event source mappings, and other properties that define the your serverless application.

Note

A key element of the Amazon SAM template is the Amazon SAM template specification. This specification provides the short-hand syntax that, when compared to Amazon CloudFormation, allows to you use fewer lines of code to to define the resources, event source mappings, permissions, APIs, and other properties of your serverless application.

This section provides details on how you use sections in the Amazon SAM template to define resources types, resource properties, data types, resource attributes, intrinsic functions, and API Gateway extensions.

Amazon SAM templates are an extension of Amazon CloudFormation templates, with unique syntax types that use shorthand syntax with fewer lines of code than Amazon CloudFormation. This speeds up your development when building a serverless application. For more information, refer to Amazon SAM resources and properties. For the full reference for Amazon CloudFormation templates, see Amazon CloudFormation Template Reference in the Amazon CloudFormation User Guide.