Skip to content

Commit

Permalink
Allow passing a roleArn and externalId when using ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
rbclark committed Sep 25, 2023
1 parent 38d8579 commit fb838b2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,16 @@ export default class Provider extends CloudGraph.Client {
}
if (usingEnvCreds) {
this.logger.success('Using credentials set by ENV variables')
if(role) {
this.logger.success(`roleARN: ${chalk.underline.green(
obfuscateSensitiveString(role)
)}`)
}
if(externalId) {
this.logger.success(`externalId: ${chalk.underline.green(
obfuscateSensitiveString(externalId)
)}`)
}
} else {
this.logger.success('Found and using the following AWS credentials')
this.logger.success(
Expand Down Expand Up @@ -702,7 +712,7 @@ export default class Provider extends CloudGraph.Client {
// If the user has passed aws creds as env variables, dont use profile list
if (usingEnvCreds) {
rawData = await this.getRawData(
{ profile: 'default', roleArn: undefined, externalId: undefined },
{ profile: 'default', roleArn: process.env.AWS_ROLE_ARN, externalId: process.env.AWS_ROLE_EXTERNAL_ID },
opts
)
} else {
Expand Down

0 comments on commit fb838b2

Please sign in to comment.