gofaas
gofaas copied to clipboard
seeding DynamoDB with data
What's the best way to seed DB with data from a json file?
- Another lambda/worker function?
- How to best make sure the function is run one-off & only if DB is not already seeded?
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
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?
Could you use something like data pipeline to dump something in s3 > dynamo?
@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