AWS Serverless lambda


Serverless basically means uploading of your code/lambda functions on AWS.

In my case, I wrote a simple lambda first.


For using serverless, yml file is required.


--------------------------------------------
service: serverless-app
provider:
  name: aws
  runtime: nodejs12.x
  stage: dev
  region: ap-south-1
  memorySize: 128

functions:
  helloOne: <-----lambda function name
    handler: serverless-app.handler <----------format:<module>.<handler>
    events: 
      - http: 
          path: /
          method: ANY
          cors: true
      - http: 
          path: /{proxy+}
          method: ANY
          cors: true
--------------------------------------------

Once "serverless deploy" command function, output will give the endpoints. Like below:-

--------------------------------------------
Service Information
service: serverless-app
stage: dev
region: ap-south-1
stack: serverless-app-dev
resources: 14
api keys:
  None
endpoints:
  ANY - https://kjhydnbhz4.execute-api.ap-south-1.amazonaws.com/dev/
  ANY - https://kjhydnbhz4.execute-api.ap-south-1.amazonaws.com/dev/{proxy+}
functions:
  helloOne: serverless-app-dev-helloOne
--------------------------------------------

Comments

Popular posts from this blog

Google Sign In (using Firebase)

Save Birds - Published 2nd App

Published my First App - Coin Man