techgaun / dynamodb-copy-table

A simple python script to copy dynamodb table (useful for achieving renaming of table)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dynamodb-copy-table-python3

A simple python 3 script to copy dynamodb table


Requirements

  • Python 3.x
  • boto (pip install boto)

Usage

A simple usage example:

$ python dynamodb-copy-table.py src_table dst_table

The following environment variables can be used:

Variable Purpose
AWS_DEFAULT_REGION Select the region (the default region is us-west-2)
DISABLE_CREATION Disable the creation of a new table (Useful if the table already exists)
DISABLE_DATACOPY Disable the copying of data from source table to destination table
$ AWS_DEFAULT_REGION=us-east-1 DISABLE_CREATION=yes DISABLE_DATACOPY=yes \
python dynamodb-copy-table.py src_table dst_table

Docker Image

The docker image is available as techgaun/dynamodb-copy-table:latest in the official docker hub that you can pull from.

Usage:

# pull image down
docker pull techgaun/dynamodb-copy-table:latest

# invoke help
$ docker run --rm -it techgaun/dynamodb-copy-table:latest
Usage: dynamodb-copy-table.py <source_table_name> <destination_table_name>

# invoke copy
docker run -e AWS_ACCESS_KEY_ID=abc -e AWS_SECRET_ACCESS_KEY=def --rm -it techgaun/dynamodb-copy-table:latest src dest

References

About

A simple python script to copy dynamodb table (useful for achieving renaming of table)

License:MIT License


Languages

Language:Python 84.0%Language:Dockerfile 16.0%