DynamoDB: Delete Table (Guide w/ Code Examples)

Provided by Rafal Wilinski
To delete a DynamoDB table using the JavaScript SDK, you can use the deleteTable
method. The below example shows how to use this method to delete a table.
However, it will only delete the table if it already exists and no longer has any items or if you set the skip_table_deletion
flag to true. Also, the table must be in the ACTIVE
state.
const AWS = require('aws-sdk'); const dynamodb = new AWS.DynamoDB(); const params = { TableName: 'myTable' }; dynamodb.deleteTable(params, (err, data) => { if (err) { console.error("Unable to delete table. Error JSON:", JSON.stringify(err, null, 2)); } else { console.log("Deleted table. Table description JSON:", JSON.stringify(data, null, 2)); } });
Similar Code Examples
- DynamoDB: Query Date Range
- DynamoDB: Get Last Inserted Item
- DynamoDB: Query JSON
- DynamoDB: Query Items
- DynamoDB: Get List Of Items
- DynamoDB: Query Count
- DynamoDB: Batch Get
- DynamoDB: Attribute Not Null
- DynamoDB: Get Multiple Items
- DynamoDB: Get Unique Values
- DynamoDB: Increment Counter
- DynamoDB: Create if Not Exists
- DynamoDB: Delete All Items With Partition Key
- DynamoDB Get in Typescript
- DynamoDB: Bulk Insert
Spend less time in the AWS console, use Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase