Pre requisites:
- AWS Account with admin permission
- Node/NPM installed
Steps to create the serverless application:
- Installing serverless package globally
sudo npm install serverless -g
- Create a new serverless project
serverless create -t aws-nodejs
-
Login to your AWS account and create an IAM User with Full Programattic access to Lambda and get the access key and secret key
-
Use the below command to configure the AWS access from your machine
serverless config credentials --provider aws --key YOUR_AWS_ACCESS_KEY --secret YOUR_AWS_SECRET_KEY
- After making the code change as the above given application, you're ready to deploy the application.
serverless deploy
- Once the application is deployed you'll get the API endpoint which you can use it like a REST API call from browser or postman or from any other application. You can also view the lambda in the AWS Lambda Dashboard.