Skip to content

Instantly share code, notes, and snippets.

View timchan-lumoslabs's full-sized avatar

Tim Chan timchan-lumoslabs

View GitHub Profile
@timchan-lumoslabs
timchan-lumoslabs / truncate_dynamodb.sh
Last active June 23, 2016 00:55 — forked from k3karthic/truncate_dynamodb.sh
Truncate all keys in a dynamodb table
#!/bin/bash
TABLE_NAME=$1
# Get id list
aws dynamodb scan --table-name $TABLE_NAME --profile default | grep ID | awk '{ print $2 }' > ~/bin/truncate.list
# Delete from id list
cat ~/bin/truncate.list | xargs -IID aws dynamodb delete-item --table-name $TABLE_NAME --key '{ "id": { "S": "ID" }}'
@k3karthic
k3karthic / truncate_dynamodb.sh
Last active July 12, 2022 18:56
Truncate all keys in a dynamodb table
#!/bin/bash
TABLE_NAME=$1
# Get id list
aws dynamodb scan --table-name $TABLE_NAME | grep ID | awk '{ print $2 }' > /tmp/truncate.list
# Delete from id list
cat /tmp/truncate.list | xargs -IID aws dynamodb delete-item --table-name $TABLE_NAME --key '{ "id": { "S": "ID" }}'