Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Install serverless globally
- npm install -g serverless
- # All serverless commands
- sls --help
- # Help Serverless credentials
- sls config credentials --help
- # Create AWS credentials file in ~/.aws
- sls config credentials --provider aws --key <access-key-id> --secret <secret> --profile <profilename>
- # Create a serverless project for Node.js within AWS Lambda
- sls create --template aws-nodejs --path <path-to-store> --name <name-of-the-project>
- # Invoke function locally -help
- sls invoke local --help
- # Invoke function locally.
- sls invoke local -f <function-name-in-serverless.yml>
- # Deploy functions from serverless.yml to AWS Lambda
- sls deploy
- # Invoke function locally help
- sls invoke --help
- # Invoke function
- sls invoke -f <function-name-in-serverless.yml>
- # Show logs of a function
- sls 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/**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement