Skip to content
A command line toolkit for aws dynamodb
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
calc
config
mock
retryer
service
toolkit
.gitignore
.goreleaser.yml
.travis.yml
LICENSE
Makefile
README.md
go.mod
go.sum
main.go

README.md



DynamoDB Toolkit

A command line toolkit for aws dynamodb




dynamotk is a command line toolkit for aws dynamodb that provides some useful utilities that are not supported by dynamodb operations and official aws cli tools.

Installation

Using go get

Go version 1.10 or higher is required.

go get github.com/mingrammer/dynamodb-toolkit

Using homebrew

brew tap mingrammer/homebrew-taps
brew install dynamodb-toolkit

Using .tar.gz archive

Download gzip file from Github Releases according to your OS. Then, copy the unzipped executable to under system path.

Features

  • Table truncate
  • Coming soon... (maybe dump/restore features)

Usage

Truncate

# Truncate the `user` table from local dynamodb.
dynamotk --endpoint http://localhost:8000 truncate --table-names user

# Truncate the `user`, `item` tables from aws dynamodb with default credentials.
dynamotk truncate --table-names user,item

# You can also pass the `access key id`, `secret access key`, `profile` and `region` optionally. (see `dynamotk -h`)
dynamotk --access-key-id xxx --secret-access-key xxx truncate --table-names user,item

# Truncation is just (concurrently) repeating the delete operations for all keys.
# So if your tables are big, it can cause cost overhead.
# In this case, you can use `--recreate` option.
# It will delete the table itself and recreate the table while preserving the description.
dynamotk --profile prod --region ap-northeast-2 truncate --table-names largetable --recreate

Known issues

When throttling happens, dynamotk does not retry read or write (delete request), so some items could be remaining not deleted. I should support backoff-retry algorithm to fix it.

For now, you should run the truncate command multiple times until the table becomes empty to overcome this issue or use --recreate option.

License

MIT

You can’t perform that action at this time.