The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.
The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.
The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.
To use the SAM transform, add AWS::Serverless-2016-10-31 to the Transform section of your CloudFormation template.
Benefits of using the SAM transform include:
Save the following as template.yaml:
Transform: AWS::Serverless-2016-10-31
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs24.x
Handler: index.handler
InlineCode: |
exports.handler = async (event) => {
console.log(event);
}And deploy it with the SAM CLI:
sam sync --stack-name sam-appThe AWS::Serverless::Function resource will create a AWS Lambda function that logs events it receives.
Under the hood, the template is transformed into the JSON equivalent of the following CloudFormation template:
…For a more thorough introduction, see the this tutorial in the Developer Guide.
You'll need to have Python 3.8+ installed.
Create a virtual environment:
python3 -m venv .venv
source .venv/bin/activateSet up dependencies:
make initRun tests:
make prSee DEVELOPMENT_GUIDE.md for further development instructions, and CONTRIBUTING.md for the contributing guidelines.
The best way to interact with the team is through GitHub. You can either create an issue or start a discussion.
You can also join the #samdev channel on Slack.
AWS::Serverless::MicrovmImage.CodeUri has no default and no local-file support, making a required-parameter bootstrap deploy impossible
EcsRunTaskPolicy should take ECS ARN, not task definition (family:revision)
[Feature Request] Add nodejs26.x runtime support to SAM specification
HttpApi: explicit AuthorizationScopes: [] is silently overridden by the authorizer's default scopes
Implicit API: local PropagateTags: false is silently overridden by global PropagateTags: true
transform() mutates the caller's template; transforming the same template twice fails
SAM transform silently drops unrecognized CodeUri/ContentUri sub-properties despite schema declaring additionalProperties: false
Lambda with AutoPublishAlias and AutoPublishAliasAllProperties does not create a new version when the referenced Parameter value changes
Enabling `BinaryMediaTypes` on `AWS::Serverless::Api` Base64-encodes request payload body
Feature: Support for `RetentionInDays` and `Retain` in `LoggingConfig` for `AWS::Serverless::Function`