capabilities.work

Drain and Delete a Table

A 3-step recipe with Amazon DynamoDB. We can help you get access.

Recipe · 3 steps

Drain and Delete a Table

Scan, batch-delete items, and then delete the table.

  1. Scan the table to collect the keys of the items that need to be removed before the table can be deleted.
  2. Batch-delete the scanned items to empty the table.
  3. Delete the now-empty table; the response reports DELETING status.
What you'll need to have ready
  • tableName: The name of the table to drain and delete.
  • projectionExpression: Projection expression limiting the Scan to key attributes.
  • deleteRequestItems: The BatchWriteItem RequestItems map of table name to an array of DeleteRequest objects keyed by primary key.
For your developer

Arazzo workflow amazon-dynamodb:drain-and-delete-table, 3 operations: Scan → BatchWriteItem → DeleteTable. Specs on APIs.io.