SCC
Brasil
os cloud gurus
Software Cloud Consulting
Your software development, cloud, consulting & shoring company
AWS gives some simple options to copy data from one dynamodb to a new dynamodb table,
like using export a csv file and importing it to a new table,
but unfortunatly the situation is not so simple if your use case needs to put the data into an existing DynamoDB Table,
to overcome this problem, we created a simple lambda that copy data from one dynamodb table to another in the same account.
This lambda normally is used as a Adhoc process
so we create an Cloudformation template to deploy this lambda when we need it, and destroy the resources easily.
The lambda uses aws sdk, to scan the source table and write the result in batches of 20 items to the destination table.
The table names are passed to the Lambda using Environment Variables, that are set when you deploy the Cloudformation template.