gl-store-s3.js/lib/aws.js

15 lines
413 B
JavaScript
Raw Normal View History

2019-05-09 20:20:14 +00:00
const AWS = require("aws-sdk");
AWS.config.setPromisesDependency(Promise);
module.exports = options => {
AWS.config.update({ region: options.bucketRegion });
if (options.accessKeyId != null && options.secretAccessKey != null) {
2019-05-09 20:20:14 +00:00
AWS.config.update({
credentials: new AWS.Credentials({
accessKeyId: options.accessKeyId,
secretAccessKey: options.secretAccessKey
})
2019-05-09 20:20:14 +00:00
});
}
};