Created
August 29, 2021 12:57
-
-
Save supernovaplus/292f8b3f65f434a3a43fcdf814053d27 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
require("dotenv").config(); | |
const AWS = require('aws-sdk'); | |
const s3config = new AWS.Config({ | |
credentials: new AWS.Credentials({ | |
accessKeyId: process.env.accessKeyId, | |
secretAccessKey: process.env.secretAccessKey | |
}), | |
region: 'nl-ams', | |
endpoint: new AWS.Endpoint('https://s3.nl-ams.scw.cloud') | |
}); | |
const s3 = new AWS.S3(s3config); | |
s3.listBuckets(function(err, data) { | |
if (err) { | |
console.log("Error", err); | |
} else { | |
console.log("Success", data.Buckets); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment