Skip to content

Commit 8546b6e

Browse files
committed
Allow passing a roleArn and externalId when using ENV
1 parent 38d8579 commit 8546b6e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/services/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ 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(externalId)}`)
440+
}
433441
} else {
434442
this.logger.success('Found and using the following AWS credentials')
435443
this.logger.success(
@@ -702,7 +710,7 @@ export default class Provider extends CloudGraph.Client {
702710
// If the user has passed aws creds as env variables, dont use profile list
703711
if (usingEnvCreds) {
704712
rawData = await this.getRawData(
705-
{ profile: 'default', roleArn: undefined, externalId: undefined },
713+
{ profile: 'default', roleArn: process.env.AWS_ROLE_ARN, externalId: process.env.AWS_ROLE_EXTERNAL_ID },
706714
opts
707715
)
708716
} else {

0 commit comments

Comments
 (0)