Retour au classement

aws/serverless-application-model

Pythonaws.amazon.com/serverless/sam

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

serverlessawslambdaaws-samsamsam-specificationserverless-applicationsserverless-application-model
Croissance des étoiles
Étoiles
9.6k
Forks
2.5k
Croissance hebdomadaire
Issues
92
5k
nov. 2016janv. 2020avr. 2023juil. 2026
ArtefactsPyPIpip install serverless-application-model
README

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

Dépôts similaires
anuraghazra/github-readme-stats

:zap: Dynamically generated stats for your github readmes

JavaScriptnpmMIT Licenseprofile-readmedynamic
github-readme-stats.vercel.app
79.8k35.5k
appwrite/appwrite

Appwrite® - complete cloud infrastructure for your web, mobile and AI apps. Including Auth, Databases, Storage, Functions, Messaging, Hosting, Realtime and more

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenseappwritedocker
appwrite.io
56.6k5.6k
serverless/serverless

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.

JavaScriptnpmOtherserverlessserverless-framework
serverless.com
46.9k5.7k
Kong/kong

🦍 The API and AI Gateway

LuaApache License 2.0api-gatewaymicroservices
konghq.com/install/
43.8k5.2k
pingcap/tidb

TiDB is built for agentic workloads that grow unpredictably, with ACID guarantees and native support for transactions, analytics, and vector search. No data silos. No noisy neighbors. No infrastructure ceiling.

GoGo ModulesApache License 2.0distributed-databasedistributed-transactions
tidb.io
40.3k6.2k
firecracker-microvm/firecracker

Secure and fast microVMs for serverless computing.

Rustcrates.ioApache License 2.0virtual-machinesandbox
firecracker-microvm.io
35.6k2.5k
surrealdb/surrealdb

A scalable, distributed, collaborative, document-graph database, for the realtime web

Rustcrates.ioOtherdatabasedistributed
surrealdb.com
32.7k1.3k
openfaas/faas

OpenFaaS - Serverless Functions Made Simple

GoGo ModulesOtherfunctions-as-a-servicefunctions
openfaas.com
26.2k2k
dapr/dapr

Dapr is a portable runtime for building distributed applications across cloud and edge, combining event-driven architecture with workflow orchestration.

GoGo ModulesApache License 2.0microservicesmicroservice
dapr.io
26k2.1k
pulumi/pulumi

Pulumi - Infrastructure as Code in any programming language 🚀

GoGo ModulesApache License 2.0infrastructure-as-codeserverless
pulumi.com
25.5k1.4k
neondatabase/neon

Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, code-like database branching, and scale to zero.

Rustcrates.ioApache License 2.0postgrespostgresql
neon.tech
22.6k1k
alibaba/ice

🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)

TypeScriptnpmMIT Licensereactreact-router
ice.work
18.6k2.1k