Skip to content

Instantly share code, notes, and snippets.

@edwint88
Created November 23, 2021 23:20
Show Gist options
  • Select an option

  • Save edwint88/0fadef69555b62a613bc16a766dff44c to your computer and use it in GitHub Desktop.

Select an option

Save edwint88/0fadef69555b62a613bc16a766dff44c to your computer and use it in GitHub Desktop.

Revisions

  1. edwint88 created this gist Nov 23, 2021.
    5 changes: 5 additions & 0 deletions AWS dynamodb clear table
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    aws dynamodb scan --table-name $TABLE_NAME --attributes-to-get "$KEY" \
    --query "Items[].$KEY.S" --output text | \
    tr "\t" "\n" | \
    xargs -t -I keyvalue aws dynamodb delete-item --table-name $TABLE_NAME \
    --key "{\"$KEY\": {\"S\": \"keyvalue\"}}"