AWS's CLI for building, testing locally and deploying serverless apps with SAM templates
open sourceApache-2.0free
The AWS SAM CLI is Amazon Web Services' open source command-line tool for developing serverless applications made of AWS Lambda functions, Step Functions, API Gateway, EventBridge, SQS, SNS and other services, described in AWS Serverless Application Model (SAM) or CloudFormation templates. sam init starts a project from templates, sam build compiles and packages functions (zip or container images), sam local runs Lambda functions and API Gateway in a Lambda-like Docker container on your machine (for SAM and AWS CDK apps), sam sync pushes changes to a development stack in the cloud, sam deploy deploys, sam pipeline init generates CI/CD pipelines, and sam logs and sam traces tail CloudWatch logs and X-Ray traces. It's written in Python and installs with pip or Homebrew.
Ways to install
Package managers
Problems it solves
- run and debug my Lambda function locally before deploying it
- deploy a serverless API on AWS from a template with one command
- set up a CI/CD pipeline for my AWS serverless app
Features
- sam init: start from AWS-provided application templates
- sam build: build and package zip or image Lambda functions
- sam local: test Lambda functions and API Gateway locally in Docker
- sam sync: sync changes to a cloud development environment (SAM Accelerate)
- sam deploy and sam pipeline init for deployments and CI/CD pipelines
- sam logs and sam traces for CloudWatch logs and X-Ray traces
Limitations
- Local testing of Lambda functions and API Gateway runs in Docker, so Docker must be installed.3
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what AWS SAM CLI does.
- Serverless Framework Deploy serverless apps and their infrastructure to AWS Lambda from YAML
- AWS CDK Define AWS infrastructure in TypeScript, Python, Java, .NET or Go
- Fission Serverless functions framework for Kubernetes
- OpenFaaS Serverless functions on any Kubernetes cluster
