nzoschke / gofaas

A boilerplate Go and AWS Lambda app. Demonstrates an expert configuration of 10+ AWS services to support running Go functions-as-a-service (FaaS).
Apache License 2.0
800 stars 43 forks source link

seeding DynamoDB with data #35

Open johnpearson555 opened 6 years ago

johnpearson555 commented 6 years ago

What's the best way to seed DB with data from a json file?

nzoschke commented 6 years ago

Great question... one-off admin tasks is not obvious with Lambda in general. Particularly if you are used to interactive admin like “heroku run bash”.

The default strategy is to do everything on you computer with AWS keys and the AWS CLI.

But I suspect there is a more “app” centric pattern to develop here

johnpearson555 commented 6 years ago

Ah, I see. Wish there was a better way. I'd would be great to package everything together in a single cloudformation template to get things up and running.

Would a bash script that runs conditionally in the Makefile make sense?

mwarkentin commented 6 years ago

Could you use something like data pipeline to dump something in s3 > dynamo?

johnpearson555 commented 6 years ago

@mwarkentin that's a good idea. I haven't used that before. I see there is support for it in Cloudformation templates https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datapipeline-pipeline.html