Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save supernovaplus/292f8b3f65f434a3a43fcdf814053d27 to your computer and use it in GitHub Desktop.
Save supernovaplus/292f8b3f65f434a3a43fcdf814053d27 to your computer and use it in GitHub Desktop.
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