Skip to content

AlexanderShushunov/s3-dynamo-http

Repository files navigation

APV

It is AWS SAM project.

WORK IN PROGRESS!

How it works:

  • somebody uploads a csv file to a S3 bucket (see SrcBucketName in template.yaml) I use apv-user-data-src. It is hardcoded in events/event-s3.json and help-scripts/upload-to-s3.sh
  • lambda S3ToDynamoFunction reads this file and puts the data do DynamoDB
  • lambda receives http request with user id and returns user's segment from DB

Build

sam build

Deploy to AWS

sam build
sam deploy

You can use help-scripts/upload-to-s3.sh to test it on AWS.

For local run

Remove .aws-sam folder.

npm i
npm run watch

In a separate terminal

sam local invoke S3ToDynamoFunction --event-name ./events/event-s3.json

Clean-up

aws cloudformation delete-stack --stack-name {stack-name}

Resources: