Skip to content

Instantly share code, notes, and snippets.

View pushplay's full-sized avatar

Jeffery Grajkowski pushplay

View GitHub Profile
@pushplay
pushplay / clearTable.sh
Last active January 4, 2023 14:14
Delete all items (clear) in a DynamoDB table using bash
#!/bin/bash
TABLE_NAME=TableName
KEY=id
aws dynamodb scan --table-name $TABLE_NAME --attributes-to-get "$KEY" --query "Items[].id.S" --output text | tr "\t" "\n" | xargs -t -I keyvalue aws dynamodb delete-item --table-name $TABLE_NAME --key '{"id": {"S": "keyvalue"}}'