Skip to content

Commit 840965c

Browse files
committed
Added an option to specify an endpoint
Added log message
1 parent 2fb928f commit 840965c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/s3.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = CoreObject.extend({
2727
const sessionToken = this.plugin.readConfig('sessionToken');
2828
const profile = this.plugin.readConfig('profile');
2929
const signatureVersion = this.plugin.readConfig('signatureVersion');
30+
const endpoint = this.plugin.readConfig('endpoint');
3031

3132
if (accessKeyId && secretAccessKey) {
3233
this.plugin.log('Using AWS access key id and secret access key from config', { verbose: true });
@@ -49,6 +50,11 @@ module.exports = CoreObject.extend({
4950
AWS.config.credentials = new AWS.SharedIniFileCredentials({ profile: profile });
5051
}
5152

53+
if (endpoint) {
54+
this.plugin.log('Using endpoint from config', { verbose: true });
55+
s3Options.endpoint = new AWS.Endpoint(endpoint);
56+
}
57+
5258
this._client = this.plugin.readConfig('s3Client') || new AWS.S3(s3Options);
5359
},
5460

0 commit comments

Comments
 (0)