Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. # Install serverless globally
  2. npm install -g serverless
  3.  
  4. # All serverless commands
  5. sls --help
  6.  
  7. # Help Serverless credentials
  8. sls config credentials --help
  9.  
  10. # Create AWS credentials file in ~/.aws
  11. sls config credentials --provider aws --key <access-key-id> --secret <secret> --profile <profilename>
  12.  
  13. # Create a serverless project for Node.js within AWS Lambda
  14. sls create --template aws-nodejs --path <path-to-store> --name <name-of-the-project>
  15.  
  16. # Invoke function locally -help
  17. sls invoke local --help
  18.  
  19. # Invoke function locally.
  20. sls invoke local -f <function-name-in-serverless.yml>
  21.  
  22. # Deploy functions from serverless.yml to AWS Lambda
  23. sls deploy
  24.  
  25. # Invoke function locally help
  26. sls invoke --help
  27.  
  28. # Invoke function
  29. sls invoke -f <function-name-in-serverless.yml>
  30.  
  31. # Show logs of a function
  32. sls logs -f <function-name-in-serverless.yml>
  33.  
  34. # Tail logs of a function
  35. serverless logs -f <function-name-in-serverless.yml> --tail
  36.  
  37. # Sample config for an Alexa AWS function
  38. service: serverless-alexa-aws-test # resulting function name in AWS Lambda
  39.  
  40. provider:
  41. name: aws
  42. runtime: nodejs6.10
  43. stage: dev
  44. region: eu-west-1 # Ireland
  45. profile: my-aws-credentials-profile
  46.  
  47. functions:
  48. alexatestskill:
  49. handler: handler.alexatestskill
  50. events:
  51. - alexaSkill
  52.  
  53. package:
  54. exclude:
  55. - node_modules/**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement