Last active
October 7, 2020 15:42
-
-
Save radzionc/8f0e1dcc71790b70b99d29b2ed5611b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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