AWS SAM templates can include several major sections. Only the Transform and Resources sections are required.
You can include template sections in any order. However, as you build your template, it can be helpful to use the logical order that's shown in the following list. This is because the values in one section might refer to values from a previous section.
Transform (required)
For AWS SAM templates, you must include this section with a value of AWS::Serverless-2016-10-31.
Additional transforms are optional. For more information about transforms, see Transform in the AWS CloudFormation User Guide.
Globals (optional)
Properties that are common to all your serverless functions, APIs, and simple tables. All the AWS::Serverless::Function, AWS::Serverless::Api, and AWS::Serverless::SimpleTable resources inherit the properties that are defined in the Globals section.
This section is unique to AWS SAM. There isn't a corresponding section in AWS CloudFormation templates.
Description (optional)
A text string that describes the template.
This section corresponds directly with the Description section of AWS CloudFormation templates.
Metadata (optional)
Objects that provide additional information about the template.
This section corresponds directly with the Metadata section of AWS CloudFormation templates.
Parameters (optional)
Values to pass to your template at runtime (when you create or update a stack). You can refer to parameters from the Resources and Outputs sections of the template.