AWS › AWS Serverless Application Model (SAM)
What is AWS SAM and how does it simplify building and deploying serverless applications?
BeginnerAnswer
AWS SAM, or Serverless Application Model, is an open source framework that provides a simplified shorthand syntax for defining serverless resources like Lambda functions, API Gateway endpoints, and DynamoDB tables, which SAM then automatically transforms into a full CloudFormation template during deployment, letting you define a complete serverless application with significantly less code than writing raw CloudFormation directly.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app.handler
Runtime: python3.12Real-world example A developer building a serverless API defines their Lambda function, API Gateway endpoint, and DynamoDB table using SAM's concise syntax, requiring far fewer lines of configuration than would be needed to define the same resources directly in raw CloudFormation.