DynamoDB: Delete Table (Guide w/ Code Examples)

Provided by Rafal Wilinski
Last updated: October 23rd, 2026
DeleteTableCommand deletes the table and its data asynchronously. Confirm the account, Region and table name before running it; use the waiter when subsequent work requires deletion to finish.
Install @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb, use an ES module on a supported Node.js runtime, and configure an AWS Region and credentials. The examples use an existing Orders table with String keys pk and sk unless an index or timestamp key is described.
import { DynamoDBClient, DeleteTableCommand, waitUntilTableNotExists } from "@aws-sdk/client-dynamodb"; const client = new DynamoDBClient({}); await client.send(new DeleteTableCommand({ TableName: "Orders" })); await waitUntilTableNotExists( { client, maxWaitTime: 120 }, { TableName: "Orders" }, );
Deletion protection must be disabled before this operation can succeed. Deleting the table also removes its indexes; it is different from deleting all items.
Reference: AWS DeleteTable API. For related access patterns, see DynamoDB query examples.
Similar Code Examples
- DynamoDB: Like
- DynamoDB: Delete Multiple Items in Javascript
- DynamoDB: Query Global Secondary Index in Nodejs
- DynamoDB: Attribute Not Null
- DynamoDB Get in Typescript
- DynamoDB: Delete All Items With Partition Key
- DynamoDB: Get Last 10 Records
- DynamoDB: Query KeyConditionExpression
- DynamoDB: Query Items
- DynamoDB: Increment Counter
- DynamoDB: Get By ID
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Bulk Insert
- DynamoDB: Query Greater Than
- DynamoDB: Query Ends With
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today