Skip to content

Instantly share code, notes, and snippets.

@radzionc
Last active October 7, 2020 15:42
Show Gist options
  • Save radzionc/8f0e1dcc71790b70b99d29b2ed5611b9 to your computer and use it in GitHub Desktop.
Save radzionc/8f0e1dcc71790b70b99d29b2ed5611b9 to your computer and use it in GitHub Desktop.
const aws = require('aws-sdk')
const { TABLES_PARAMS } = require('../../constants/db')
module.exports = async () => {
const dynamodb = new aws.DynamoDB()
try {
const data = await Promise.all(
TABLES_PARAMS.map(({ TableName }) => dynamodb.deleteTable({ TableName }).promise()))
)
console.log('Deleted table: ', JSON.stringify(data, null, 2))
} catch (err) {
console.error('Delete fail: ', JSON.stringify(err, null, 2))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment