Created
January 15, 2021 17:09
-
-
Save mwcz/71273168ae1a163e4c15657e5f41e659 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 { S3Client, ListObjectsV2Command } = require("@aws-sdk/client-s3"); | |
const client = new S3Client({ | |
region: 'us-east-1', | |
credentials: { | |
accessKeyId: process.env['EYEBROWSE_S3_ACCESS_KEY'], | |
secretAccessKey: process.env['EYEBROWSE_S3_SECRET_ACCESS_KEY'], | |
}, | |
clientSideMonitoring: true | |
}); | |
const listObjCmd = new ListObjectsV2Command({ | |
Bucket: 'eyebrowse-test-1' | |
}); | |
async function main() { | |
try { | |
const data = await client.send(listObjCmd); | |
console.log(data); | |
} catch (error) { | |
console.error(error); | |
} finally { | |
console.log('done'); | |
} | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment