aws lambda udemy

1) Commands: 

Surface

  • sls deploy
  • serverless config credentials -o --provider aws --key ${key} --secret ${secretkey}
  • sls create --template aws-python --path hello-world-python
  • sudo npm install -g serveless
  • sls invoke -f hello -l
  • sls deploy function -f hello
  • sudo npm install -g serverless
  • sudo apt install npm
  • sls log -f hello -t 
  • sls remove
A Little Deep
  • sls create --template aws-java-maven --path java-maven-example
  • sls create --template aws-nodejs --path nodejs-example

2) Links:

3) Notes:


4) serverless.yml

provider:
name: aws
runtime: python3.9
lambdaHashingVersion: 20201221
profile: serverless-admin
region: us-east-1
memory-size: 128
timeout: 2
iamRoleStatements:
- Effect: "Allow"
Action:
- "lambda:*"
Resource:
- "*"

functions:
hello-short-timeout:
handler: handler.hello
hello-long-timeout:
handler: handler.hello
memorySize: 256
timeout: 6

5) Erros and Solution

Error 1: This command can only be run in a Serverless service directory (serverless) 

        You need to go to the directory folder of project.
        serverless forum

Error 2:  


                

Comments

Popular posts from this blog