Skip to content

Commit cd1ebb8

Browse files
committed
Allow passing a roleArn and externalId when using ENV
1 parent 4ff65f3 commit cd1ebb8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/services/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,16 @@ export default class Provider extends CloudGraph.Client {
430430
}
431431
if (usingEnvCreds) {
432432
this.logger.success('Using credentials set by ENV variables')
433+
if(role) {
434+
this.logger.success(`roleARN: ${chalk.underline.green(
435+
obfuscateSensitiveString(role)
436+
)}`)
437+
}
438+
if(externalId) {
439+
this.logger.success(`externalId: ${chalk.underline.green(
440+
obfuscateSensitiveString(externalId)
441+
)}`)
442+
}
433443
} else {
434444
this.logger.success('Found and using the following AWS credentials')
435445
this.logger.success(
@@ -702,7 +712,7 @@ export default class Provider extends CloudGraph.Client {
702712
// If the user has passed aws creds as env variables, dont use profile list
703713
if (usingEnvCreds) {
704714
rawData = await this.getRawData(
705-
{ profile: 'default', roleArn: undefined, externalId: undefined },
715+
{ profile: 'default', roleArn: process.env.AWS_ROLE_ARN, externalId: process.env.AWS_ROLE_EXTERNAL_ID },
706716
opts
707717
)
708718
} else {

0 commit comments

Comments
 (0)