Serverless Cheatsheet¶
Serverless Framework home page
Modern serverless architectures emphasize event-driven design, leveraging managed services (like EventBridge, SQS, and API Gateway) to trigger ephemeral compute (Lambda) with minimal operational overhead.
Install¶
Examples¶
CLI Cheatsheet¶
Note: sls is an alias for the serverless command.
- Create a Service:
# NodeJS
sls create -p [SERVICE NAME] -t aws-nodejs
# Python
sls create --path myService --template aws-python3
- Deploy All
Use this when you have made changes to your Functions, Events or Resources in serverless.yml or you simply want to deploy all changes within your Service at the same time.
- Deploy Function
Use this to quickly overwrite your AWS Lambda code on AWS, allowing you to develop faster without deploying CloudFormation changes.
- Invoke Function
Invokes an AWS Lambda Function on AWS and returns logs.
- Invoke Local
Invokes a function locally for testing.
- Streaming Logs
Open up a separate tab in your console and stream all logs for a specific Function.
- Remove Service
Deletes all deployed AWS resources associated with the service.