Back to Lessons

AWS SAM Serverless Application Model

April 5, 2026

SAM CLI for Serverless

Simplifies Lambda + API Gateway + DynamoDB deployment.

SAM Template Structure

template.yaml:
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31

Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: src/
      Handler: app.lambdaHandler
      Runtime: nodejs18.x
      Events:
        Api:
          Type: Api
          Properties:
            Path: /hello
            Method: get

Commands:
sam build
sam deploy --guided
sam local invoke
sam local start-api

Development Workflow

  • Local testing (Docker Lambda)
  • CloudShell SAM CLI
  • Provisioned Concurrency
  • Application packaging