Skip to content

Instantly share code, notes, and snippets.

@serhatcan
Created September 6, 2016 05:49
Show Gist options
  • Save serhatcan/b20bbf9261737172385f8a650544785b to your computer and use it in GitHub Desktop.
Save serhatcan/b20bbf9261737172385f8a650544785b to your computer and use it in GitHub Desktop.
dynamodb.listTables().eachPage(function(err, data) {
if (err) {
ppJson(err); // an error occurred
} else if (data) {
console.log(data);
data["TableNames"].forEach(function(tablename, i) {
console.log(tablename);
var params = {
TableName: tablename,
};
dynamodb.deleteTable(params, function(err, data) {
if (err) ppJson(err); // an error occurred
else ppJson(data); // successful response
});
})
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment