Skip to content

Instantly share code, notes, and snippets.

@nake89
Created August 6, 2021 05:32
Show Gist options
  • Save nake89/bf5875db9df6e838faa0baf81057b094 to your computer and use it in GitHub Desktop.
Save nake89/bf5875db9df6e838faa0baf81057b094 to your computer and use it in GitHub Desktop.
const {
DynamoDBClient,
ListTablesCommand,
} = require("@aws-sdk/client-dynamodb")
;(async () => {
const config = {
region: process.env.REGION,
credentials: {
accessKeyId: process.env.AWS_KEY,
secretAccessKey: process.env.AWS_SECRET,
},
}
const client = new DynamoDBClient(config)
const command = new ListTablesCommand({})
try {
const results = await client.send(command)
console.log(results.TableNames.join("\n"))
} catch (err) {
console.error(err)
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment