LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

sam

AWS Serverless Application Model CLI

TLDR

Initialize a serverless application
$ sam init
copy
Initialize with specific runtime
$ sam init --runtime [python3.12]
copy
Build Lambda function code
$ sam build
copy
Run serverless application locally
$ sam local start-api
copy
Invoke a Lambda function locally
$ sam local invoke [FunctionName]
copy
Deploy with guided prompts
$ sam deploy --guided
copy
Validate a SAM template
$ sam validate
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
build
Build Lambda function code
deploy
Deploy application to AWS
delete
Delete a deployed application and its resources
validate
Validate a SAM template
sync
Sync local changes to a deployed application
logs
Fetch and display Lambda function logs
local invoke
Invoke a Lambda function locally
local start-api
Run API Gateway locally
local start-lambda
Start a local Lambda endpoint
local generate-event
Generate sample event payloads for testing

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)

Copied to clipboard
Kai