Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/techgaun/dynamodb-copy-table

A simple python script to copy dynamodb table (useful for achieving renaming of table)
https://github.com/techgaun/dynamodb-copy-table

amazon-web-services dynamodb dynamodb-table hacktoberfest python-script

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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:

```shell
$ 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

```shell
$ 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](https://hub.docker.com/r/techgaun/dynamodb-copy-table)
in the official docker hub that you can pull from.

Usage:

```shell
# 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

# 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

- [Import and Export DynamoDB Data using AWS Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-importexport-ddb.html)