Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.24 KB

README.md

File metadata and controls

37 lines (30 loc) · 1.24 KB

weather-task

Task:

  • Create an AWS Lambda using a serverless framework.
  • Create an API using API Gateway that takes the below JSON as input. The API will trigger lambda and pass the input to lambda.
  • Lambda should read the data from the input and store it in MongoDB.
  • You will need to create corresponding Schemas and Tables for MongoDB.

Prerequisite

  1. NodeJS

sudo apt install nodejs

  1. Serverless

sudo npm install -g serverless

  1. AWS
  2. MongoDB

AWS setup

  1. Create aws account
  2. Create IAM user - To create aws services using serverless framework
    • Permissions
      • AmazonS3FullAccess
      • CloudWatchFullAccess
      • AmazonAPIGatewayAdministrator
      • AWSCloudFormationFullAccess
      • AWSLambda_FullAccess
  3. Create IAM role - To execute lambda function
    • Permissions
      • CloudWatchLogsFullAccess: To create CloudWatch log stream from Lambda function

Serverless commands

serverless create -t aws-nodejs
serverless config credentials --provider aws --key {key} --secret {secret} --overwrite
serverless deploy
serverless remove