AWS SAM is an open source model and tooling layer for defining and deploying serverless apps on AWS. The transform expands concise SAM templates into CloudFormation.
Overview
The AWS Serverless Application Model centers on a CloudFormation macro that transforms SAM templates into full CloudFormation templates when you declare AWS::Serverless-2016-10-31 in the Transform section. Short-hand resources such as AWS::Serverless::Function map to Lambda, IAM, and related AWS resources with defaults.
AWS documentation describes SAM as two parts: template syntax optimized for serverless infrastructure as code, and the SAM CLI for local build, test, debug, deploy, sync, pipeline generation, and remote Lambda invocation. Templates deploy through CloudFormation like any other stack.
Benefits stated in the project include built-in best practices, sane defaults, and an extension of CloudFormation’s syntax rather than a separate provisioning engine. Workshops cover hello-world deploys, cloud testing with the CLI, connectors, and policy templates.
The transform repository implements the macro logic developers reference when authoring template.yaml files consumed by sam build and sam deploy. Integrations also mention AWS CDK and Terraform-oriented SAM CLI workflows on AWS’s product pages.
Key features
- SAM to CloudFormation macro
- AWS::Serverless resource types
- SAM CLI build and deploy
- sam sync for rapid cloud dev
- Pipeline and CI/CD helpers
- Lambda-focused IaC defaults
- SAM Accelerate cloud testing
- CDK and Terraform CLI extensions
Use cases
- Serverless API on AWS Lambda
- IaC for event-driven apps
- Team pipelines for SAM stacks
- Local then cloud Lambda debugging
- Standardized serverless templates