aws-sam-translator 1.108.0


pip install aws-sam-translator

  Latest version

Released: Mar 17, 2026

Project Links

Meta
Author: Amazon Web Services
Requires Python: >=3.8, <=4.0, !=4.0

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console
  • Other Environment

Intended Audience
  • Developers
  • Information Technology

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11

Topic
  • Internet
  • Software Development :: Build Tools
  • Utilities

AWS SAM transform

Tests Update schema PyPI PyPI - Python Version Contribute with Gitpod

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);
        }

And deploy it with the SAM CLI:

sam sync --stack-name sam-app

The 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:

Resources:
  MyFunction:
    Type: AWS::Lambda::Function
    Properties:
      Code:
        ZipFile: |
          exports.handler = async (event) => {
            console.log(event);
          }
      Handler: index.handler
      Role: !GetAtt MyFunctionRole.Arn
      Runtime: nodejs24.x
      Tags:
        - Key: lambda:createdBy
          Value: SAM
  MyFunctionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Action:
              - sts:AssumeRole
            Effect: Allow
            Principal:
              Service:
                - lambda.amazonaws.com
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
      Tags:
        - Key: lambda:createdBy
          Value: SAM

For a more thorough introduction, see the this tutorial in the Developer Guide.

Contributing

Setting up development environment

You'll need to have Python 3.8+ installed.

Create a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Set up dependencies:

make init

Run tests:

make pr

See DEVELOPMENT_GUIDE.md for further development instructions, and CONTRIBUTING.md for the contributing guidelines.

Getting help

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.

Learn more

Workshops and tutorials

Documentation

1.108.0 Mar 17, 2026
1.107.0 Jan 29, 2026
1.106.0 Dec 17, 2025
1.105.0 Dec 02, 2025
1.104.0 Dec 01, 2025
1.103.0 Nov 21, 2025
1.102.0 Nov 19, 2025
1.101.0 Oct 10, 2025
1.100.0 Aug 28, 2025
1.99.0 Jun 19, 2025
1.98.0 Jun 04, 2025
1.97.0 Apr 11, 2025
1.96.0 Apr 03, 2025
1.95.0 Feb 21, 2025
1.94.0 Nov 21, 2024
1.93.0 Nov 21, 2024
1.92.0 Nov 09, 2024
1.91.0 Aug 19, 2024
1.90.0 Aug 15, 2024
1.89.0 May 16, 2024
1.88.0 May 06, 2024
1.87.0 Apr 04, 2024
1.86.0 Mar 07, 2024
1.85.0 Feb 15, 2024
1.84.0 Feb 03, 2024
1.83.0 Jan 05, 2024
1.82.0 Dec 05, 2023
1.81.0 Nov 23, 2023
1.80.0 Nov 16, 2023
1.79.0 Oct 23, 2023
1.78.0 Oct 13, 2023
1.77.0 Oct 06, 2023
1.76.0 Sep 28, 2023
1.75.0 Sep 19, 2023
1.74.0 Aug 31, 2023
1.73.0 Aug 10, 2023
1.72.0 Jul 29, 2023
1.71.0 Jul 05, 2023
1.70.0 Jun 22, 2023
1.69.0 Jun 15, 2023
1.68.0 May 25, 2023
1.67.0 May 16, 2023
1.66.0 Apr 27, 2023
1.65.0 Apr 19, 2023
1.64.0 Apr 06, 2023
1.63.0 Mar 27, 2023
1.62.0 Mar 14, 2023
1.61.0 Mar 10, 2023
1.60.1 Feb 28, 2023
1.60.0 Feb 27, 2023
1.59.0 Feb 08, 2023
1.58.1 Jan 24, 2023
1.58.0 Jan 23, 2023
1.57.0 Jan 12, 2023
1.56.0 Jan 05, 2023
1.55.0 Nov 29, 2022
1.54.0 Nov 10, 2022
1.53.0 Oct 11, 2022
1.52.0 Oct 06, 2022
1.51.0 Sep 13, 2022
1.50.0 Aug 17, 2022
1.49.0 Aug 08, 2022
1.48.0 Jul 25, 2022
1.47.0 Jul 12, 2022
1.46.0 Jun 07, 2022
1.45.0 Apr 06, 2022
1.44.0 Mar 28, 2022
1.43.0 Mar 22, 2022
1.42.0 Nov 23, 2021
1.40.0 Nov 02, 2021
1.39.0 Sep 29, 2021
1.38.0 Jul 19, 2021
1.37.0 Jul 06, 2021
1.36.0 May 31, 2021
1.35.0 Mar 12, 2021
1.34.0 Jan 30, 2021
1.33.0 Dec 17, 2020
1.32.0 Dec 01, 2020
1.31.0 Nov 23, 2020
1.30.1 Nov 19, 2020
1.30.0 Nov 18, 2020
1.29.0 Nov 05, 2020
1.28.1 Oct 28, 2020
1.27.0 Sep 18, 2020
1.26.0 Aug 11, 2020
1.25.0 Jun 16, 2020
1.24.0 May 27, 2020
1.23.0 May 06, 2020
1.22.0 Mar 16, 2020
1.21.0 Feb 21, 2020
1.20.1 Jan 15, 2020
1.20.0 Jan 13, 2020
1.19.1 Dec 23, 2019
1.19.0 Dec 04, 2019
1.18.0 Dec 03, 2019
1.17.0 Dec 02, 2019
1.16.0 Nov 26, 2019
1.15.1 Oct 14, 2019
1.15.0 Oct 03, 2019
1.14.0 Aug 29, 2019
1.13.2 Aug 15, 2019
1.13.1 Aug 06, 2019
1.13.0 Jul 27, 2019
1.12.0 Jun 26, 2019
1.11.0 Apr 25, 2019
1.10.0 Mar 06, 2019
1.9.1 Feb 07, 2019
1.9.0 Nov 29, 2018
1.8.0 Oct 25, 2018
1.7.0 Sep 26, 2018
1.6.1 Jun 28, 2018
1.6.0 Jun 12, 2018
1.5.4 May 03, 2018
1.5.3 May 03, 2018
1.5.2 Apr 25, 2018
1.5.1 Apr 18, 2018