Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing a roleArn and externalId when using ENV #163

Open
wants to merge 2 commits into
base: alpha
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,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 @@ -696,7 +706,7 @@ export default class Provider extends CloudGraph.Client {
// If the user has passed aws creds as env variables, dont use profile list
if (usingEnvCreds) {
let {rawData: results, regions: activeRegions} = 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
)

Expand Down