Last active
March 14, 2022 08:16
-
-
Save jahe/3ed17705d8be1beaa4037519866d1fb7 to your computer and use it in GitHub Desktop.
Serverless Cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a serverless project for Node.js within AWS Lambda | |
serverless create --template aws-nodejs | |
# Create AWS credentials file in ~/.aws | |
serverless config credentials --provider aws --key <access-key-id> --secret <secret> --profile <profilename> | |
# Deploy functions from serverless.yml to AWS Lambda | |
sls deploy | |
# Invoke function | |
sls invoke -f <function-name-in-serverless.yml> | |
# Show logs of a function | |
serverless logs -f <function-name-in-serverless.yml> | |
# Tail logs of a function | |
serverless logs -f <function-name-in-serverless.yml> --tail | |
# Sample config for an Alexa AWS function | |
service: serverless-alexa-aws-test # resulting function name in AWS Lambda | |
provider: | |
name: aws | |
runtime: nodejs6.10 | |
stage: dev | |
region: eu-west-1 # Ireland | |
profile: my-aws-credentials-profile | |
functions: | |
alexatestskill: | |
handler: handler.alexatestskill | |
events: | |
- alexaSkill | |
package: | |
exclude: | |
- node_modules/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment