aws-sam-translator

The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.

Latest version: 1.94.0 registry icon
Maintenance score
100
Safety score
100
Popularity score
100
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
1.94.0 0 0 0 0 0
1.93.0 0 0 0 0 0
1.92.0 0 0 0 0 0
1.91.0 0 0 0 0 0
1.90.0 0 0 0 0 0
1.89.0 0 0 0 0 0
1.88.0 0 0 0 0 0
1.87.0 0 0 0 0 0
1.86.0 0 0 0 0 0
1.85.0 0 0 0 0 0
1.84.0 0 0 0 0 0
1.83.0 0 0 0 0 0
1.82.0 0 0 0 0 0
1.81.0 0 0 0 0 0
1.80.0 0 0 0 0 0
1.79.0 0 0 0 0 0
1.78.0 0 0 0 0 0
1.77.0 0 0 0 0 0
1.76.0 0 0 0 0 0
1.75.0 0 0 0 0 0
1.74.0 0 0 0 0 0
1.73.0 0 0 0 0 0
1.72.0 0 0 0 0 0
1.71.0 0 0 0 0 0
1.70.0 0 0 0 0 0
1.69.0 0 0 0 0 0
1.68.0 0 0 0 0 0
1.67.0 0 0 0 0 0
1.66.0 0 0 0 0 0
1.65.0 0 0 0 0 0
1.64.0 0 0 0 0 0
1.63.0 0 0 0 0 0
1.62.0 0 0 0 0 0
1.61.0 0 0 0 0 0
1.60.1 0 0 0 0 0
1.60.0 0 0 0 0 0
1.59.0 0 0 0 0 0
1.58.1 0 0 0 0 0
1.58.0 0 0 0 0 0
1.57.0 0 0 0 0 0
1.56.0 0 0 0 0 0
1.55.0 0 0 0 0 0
1.54.0 0 0 0 0 0
1.53.0 0 0 0 0 0
1.52.0 0 0 0 0 0
1.51.0 0 0 0 0 0
1.50.0 0 0 0 0 0
1.49.0 0 0 0 0 0
1.48.0 0 0 0 0 0
1.47.0 0 0 0 0 0
1.46.0 0 0 0 0 0
1.45.0 0 0 0 0 0
1.44.0 0 0 0 0 0
1.43.0 0 0 0 0 0
1.42.0 0 0 0 0 0
1.40.0 0 0 0 0 0
1.39.0 0 0 0 0 0
1.38.0 0 0 0 0 0
1.37.0 0 0 0 0 0
1.36.0 0 0 0 0 0
1.35.0 0 0 0 0 0
1.34.0 0 0 0 0 0
1.33.0 0 0 0 0 0
1.32.0 0 0 0 0 0
1.31.0 0 0 0 0 0
1.30.1 0 0 0 0 0
1.30.0 0 0 0 0 0
1.29.0 0 0 0 0 0
1.28.1 0 0 0 0 0
1.27.0 0 0 0 0 0
1.26.0 0 0 0 0 0
1.25.0 0 0 0 0 0
1.24.0 0 0 0 0 0
1.23.0 0 0 0 0 0
1.22.0 0 0 0 0 0
1.21.0 0 0 0 0 0
1.20.1 0 0 0 0 0
1.20.0 0 0 0 0 0
1.19.1 0 0 0 0 0
1.19.0 0 0 0 0 0
1.18.0 0 0 0 0 0
1.17.0 0 0 0 0 0
1.16.0 0 0 0 0 0
1.15.1 0 0 0 0 0
1.15.0 0 0 0 0 0
1.14.0 0 0 0 0 0
1.13.2 0 0 0 0 0
1.13.1 0 0 0 0 0
1.13.0 0 0 0 0 0
1.12.0 0 0 0 0 0
1.11.0 0 0 0 0 0
1.10.0 0 0 0 0 0
1.9.1 0 0 0 0 0
1.9.0 0 0 0 0 0
1.8.0 0 0 0 0 0
1.7.0 0 0 0 0 0
1.6.1 0 0 0 0 0
1.6.0 0 0 0 0 0
1.5.4 0 0 0 0 0
1.5.3 0 0 0 0 0
1.5.2 0 0 0 0 0
1.5.1 0 0 0 0 0

Stability
Latest release:

1.94.0 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Apache-1.0   -   Apache License 1.0

Not a wildcard

Not proprietary

OSI Compliant



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: nodejs18.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: nodejs18.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