AWS::Serverless Transform

The AWS::Serverless transform, which is a macro hosted by AWS CloudFormation, takes an
entire template written in the AWS Serverless Application Model (AWS SAM) syntax and
transforms and expands it into a
compliant AWS CloudFormation template. For more information about serverless applications
and
AWS SAM, see Deploying
Lambda-based Applications in the AWS Lambda Developer Guide.

Unlike custom macros, the AWS::Serverless transform doesn't require any
special permissions to use it because it is hosted by AWS CloudFormation. It can be
used by templates
in any account within AWS CloudFormation. Also, there is no charge incured when using
this transform.
AWS CloudFormation treats the AWS::Serverless transform the same as any other macro in
terms of evaluation order and scope. For more information about macros, see Using AWS CloudFormation Macros to Perform Custom Processing on
Templates.

In the following example, the template uses AWS SAM syntax to simplify
the declaration of a Lambda function and its execution role.

When creating a change set from the template, AWS CloudFormation expands the AWS SAM
syntax, as defined by the transform. The processed template expands the
AWS::Serverless::Function resource, declaring an AWS Lambda function and
an execution role.