1.0.1 • Published 3 years ago

ez-copy-dynamodb-table v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Copy AWS DynamoDB content between tables

Small NodeJS solution to copy content between two DynamoDB tables.

AWS DynamoDB does not support renaming tables or easy copying of content between two DynamoDB tables.

So this is a small dumb script that scans the whole table (mind the consumed capacity) and uses batchWrite to insert into the target table.

AWS Batch Write has two restrictions - max 25 items and 400kb per write. The later is not supported :S

Requirements

Node >=13 due to import syntax

Install

npm i or yarn

Usage:

TABLEFROM: Name of the source table to scan

TABLETO: Name of the target table

REGION: AWS Region for both tables (cross-region is possible, but noy yet)

AWSPROFILE: Name of the AWS profile on the user account. AWS Key (env?) is not supported yet

node index.js --from TABLEFROM --to TABLETO --region REGION --profile AWSPROFILE

or

npm start -- --from TABLEFROM --to TABLETO --region REGION --profile AWSPROFILE

Example:

npm start -- --from oldTable --to newTable --region us-east-1 --profile default

License

MIT

1.0.1

3 years ago

1.0.0

3 years ago