Bulk delete items from a DynamoDB table.
You can get delete-dynamodb-items
from the releases
section of this GitHub repository. There you will find downloads for your operating system and CPU architecture.
Warning: running this command will result in all the items in the specified table to be deleted immediately! There is no "are you sure?" prompt.
delete-dynamodb-items <table name> [--endpoint=URL] [--filter-expression=string] [--expression-attribute-names=JSON] [--expression-attribute-values=JSON]
The program uses the default AWS credential algorithm to determine what IAM entity and region is used. E.g. the
~/.aws/credentials
file, the AWS_*
environment variables, etc.
You can specify a special expression to filter out items you don't want deleted. AKA, the item will be deleted if the
filter matches. You can learn more about filter expressions in
AWS's DynamoDB Developer Guide
and the
filter-expression
section in the AWS CLI.
Use a combination of the --filter-expression=
, --expression-attribute-names=
, and --expression-attribute-values=
options. These options work the same way as the options on the AWS CLI.
E.g. --filter-expression='#k > :v' --expression-attribute-names='{"#k": "number"}' --expression-attribute-values='{":v": {"N": "50"}}'
You can customize the DynamoDB endpoint with the --endpoint=
(or -e
) option. Set it to the URL of the endpoint.
E.g. --endpoint=http://localhost:8002
. If unspecified, the default AWS endpoints are used.
Thank you for thinking of contributing! Please see the contributing guide.
See the contributing guide.