requirements
❯ npm install -g serverless
config serverless
❯ serverless config --provider aws --key <yourkey> --secret <yoursecret>
❯ serverless create --template aws-nodejs --path twitter-crawler
-
Deploy a Service:
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.serverless deploy -v
-
Deploy the Function:
Use this to quickly upload and overwrite your AWS Lambda code on AWS, allowing you to develop faster.
serverless deploy function -f hello
-
Invoke the Function:
Invokes an AWS Lambda Function on AWS and returns logs.
serverless invoke -f hello -l
-
Fetch the Function Logs:
Open up a separate tab in your console and stream all logs for a specific Function using this command.
serverless logs -f hello -t
-
Remove the Service:
Removes all Functions, Events and Resources from your AWS account.
serverless remove
sls invoke --function hello
sls invoke local --function hello