2025-03-14 21:59:59 -06:00
|
|
|
# sam
|
|
|
|
|
|
|
|
|
|
> AWS Serverless Application Model (SAM) CLI.
|
2025-05-08 12:26:01 -06:00
|
|
|
> More information: <https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli-corecommands.html>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Initialize a serverless application:
|
|
|
|
|
|
|
|
|
|
`sam init`
|
|
|
|
|
|
|
|
|
|
- Initialize a serverless application with a specific runtime:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`sam init {{[-r|--runtime]}} {{python3.7}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Package a SAM application:
|
|
|
|
|
|
|
|
|
|
`sam package`
|
|
|
|
|
|
|
|
|
|
- Build your Lambda function code:
|
|
|
|
|
|
|
|
|
|
`sam build`
|
|
|
|
|
|
|
|
|
|
- Run your serverless application locally:
|
|
|
|
|
|
|
|
|
|
`sam local start-api`
|
|
|
|
|
|
|
|
|
|
- Deploy an AWS SAM application:
|
|
|
|
|
|
|
|
|
|
`sam deploy`
|