I wants to delete all the existing tables in my database in DynamoDb?
Is there any way to do it?
You can use aws cli to delete all tables, may be except one table.
aws dynamodb list-tables --profile your_profile | jq .'TableNames[]' -r | grep -v table_you_dont_want_to_delete | xargs -ITABLE -n 1 aws dynamodb delete-table --table-name TABLE --profile your_profile
You can delete table using below code.
var params = {
TableName: 'table-name',
};
dynamodb.deleteTable(params, function(err, data) {
if (err) ppJson(err); // an error occurred
else ppJson(data); // successful response
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With