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 inevents/event-s3.json
andhelp-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
sam build
sam build
sam deploy
You can use help-scripts/upload-to-s3.sh
to test it on AWS.
Remove .aws-sam
folder.
npm i
npm run watch
In a separate terminal
sam local invoke S3ToDynamoFunction --event-name ./events/event-s3.json
aws cloudformation delete-stack --stack-name {stack-name}
Resources: