Skip to content

Instantly share code, notes, and snippets.

@memoryonrepeat
Last active September 12, 2022 20:58
Show Gist options
  • Save memoryonrepeat/c6d0197a57b3b024fa4d to your computer and use it in GitHub Desktop.
Save memoryonrepeat/c6d0197a57b3b024fa4d to your computer and use it in GitHub Desktop.
Exporting a DynamoDB table to a .json file
#!/bin/bash
# Dependencies: dynamo-archive
# In case there is some big tables, it is advisable to dedicate a process for each big table
# and another process for the rest, since this can work in parallel
# Can use https://github.com/bchew/dynamodump which is faster and easier
key=<AWS access key>
secret=<AWS secret>
region=<AWS region>
declare -a TABLES=(table1 table2 table3)
for t in ${TABLES[@]}
do
dynamo-archive --table=$t --key=$key --secret=$secret --region=$region > $t.json
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment