AWS SAM Translator is a library that transform SAM templates into AWS CloudFormation templates
Actively maintained. Last release 11 days ago, commits in 21 of the last 26 weeks. A safe choice.
pip install aws-sam-translatorAWS SAM transform
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:
- Built-in best practices and sane defaults.
- Local testing and debugging with the AWS SAM CLI.
- Extension of the CloudFormation template syntax.
Getting started
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);
}