Created
August 6, 2021 05:32
-
-
Save nake89/bf5875db9df6e838faa0baf81057b094 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
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