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 Get in Typescript
- DynamoDB: Get Multiple Items
- DynamoDB: Attribute Not Null
- DynamoDB: Get List Of Items
- DynamoDB: Batch Get
- DynamoDB: Query Ends With
- DynamoDB: Query Greater Than
- DynamoDB: Get Query
- DynamoDB: Get Table
- DynamoDB: GetItem
- DynamoDB: Like
- DynamoDB: Query Items
- DynamoDB: Query Global Secondary Index in Nodejs
- DynamoDB: Create if Not Exists
- DynamoDB BatchWriteItem in Typescript
Dynobase is a Professional GUI Client for DynamoDB
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2024 Dynobase