Requires :
- python 3
- aws cli & dynamo-local (for the local)
Copy a dynamo-local with
USE_LOCAL=yes python3 dynamo_copy_table.py source-table dest-table
Copy a online dynamo db:
- copy with table creation
ACCESS_KEY_ID=aws_access_key_id SECRET_ACCESS_KEY=aws_secret_access_key REGION=ap-east-1 python3 dynamo_copy_table.py source-table dest-table
- skip table creation
SKIP_CREATION=yes ACCESS_KEY_ID=aws_access_key_id SECRET_ACCESS_KEY=aws_secret_access_key REGION=ap-east-1 python3 dynamo_copy_table.py source-table dest-table
- aws-cli
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py --user
pip3 install awscli --upgrade --user
- dynamo-local
docker run -p 8000:8000 --name dynamodb-local --restart unless-stopped -d dwmkerr/dynamodb -sharedDb
- table
aws dynamodb list-tables --endpoint-url http://localhost:8000
aws dynamodb create-table --table-name Music --attribute-definitions AttributeName=Artist,AttributeType=S AttributeName=SongTitle,AttributeType=S --key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1