File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ module.exports = CoreObject.extend({
27
27
const accessKeyId = this . _plugin . readConfig ( 'accessKeyId' ) ;
28
28
const secretAccessKey = this . _plugin . readConfig ( 'secretAccessKey' ) ;
29
29
const sessionToken = this . _plugin . readConfig ( 'sessionToken' ) ;
30
+ const profile = this . _plugin . readConfig ( 'profile' ) ;
30
31
31
32
if ( accessKeyId && secretAccessKey ) {
32
33
this . _plugin . log ( 'Using AWS access key id and secret access key from config' , { verbose : true } ) ;
@@ -39,6 +40,11 @@ module.exports = CoreObject.extend({
39
40
s3Options . sessionToken = sessionToken ;
40
41
}
41
42
43
+ if ( profile ) {
44
+ this . _plugin . log ( 'Using AWS profile from config' , { verbose : true } ) ;
45
+ AWS . config . credentials = new AWS . SharedIniFileCredentials ( { profile : profile } ) ;
46
+ }
47
+
42
48
this . _client = this . _plugin . readConfig ( 's3Client' ) || new AWS . S3 ( s3Options ) ;
43
49
} ,
44
50
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ describe('s3 plugin', function() {
38
38
sessionToken : 'eeee' ,
39
39
bucket : 'cccc' ,
40
40
region : 'dddd' ,
41
+ profile : 'ffff' ,
41
42
filePattern : '*.{css,js}' ,
42
43
acl : 'authenticated-read' ,
43
44
prefix : '' ,
You can’t perform that action at this time.
0 commit comments