2019-05-09 20:20:14 +00:00
|
|
|
const AWS = require("aws-sdk");
|
|
|
|
AWS.config.setPromisesDependency(Promise);
|
|
|
|
|
2020-04-01 12:32:43 +00:00
|
|
|
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({
|
2020-04-01 12:32:43 +00:00
|
|
|
credentials: new AWS.Credentials({
|
|
|
|
accessKeyId: options.accessKeyId,
|
|
|
|
secretAccessKey: options.secretAccessKey
|
|
|
|
})
|
2019-05-09 20:20:14 +00:00
|
|
|
});
|
2020-04-01 12:32:43 +00:00
|
|
|
}
|
|
|
|
};
|