LinuxCommandLibrary

sam

AWS Serverless Application Model CLI

TLDR

Initialize a serverless application

$ sam init
copy
Initialize with specific runtime
$ sam init -r python3.7
copy
Package a SAM application
$ sam package
copy
Build Lambda function code
$ sam build
copy
Run serverless application locally
$ sam local start-api
copy
Deploy an AWS SAM application
$ sam deploy
copy

SYNOPSIS

sam command [options]

DESCRIPTION

sam is the AWS Serverless Application Model CLI. It provides tools for building, testing, and deploying serverless applications using AWS Lambda, API Gateway, and other AWS services.
The CLI supports local development and testing before cloud deployment.

PARAMETERS

init

Initialize a new serverless application
-r, --runtime runtime
Specify Lambda runtime (python3.7, nodejs18.x, etc.)
package
Package application for deployment
build
Build Lambda function code
local start-api
Run API Gateway locally
deploy
Deploy application to AWS

CAVEATS

Requires AWS credentials configured. Local testing requires Docker. Deployment creates AWS resources that may incur costs.

HISTORY

Developed by AWS to simplify serverless application development and deployment using Infrastructure as Code.

SEE ALSO

aws(1), docker(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community