Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
feat: load aws_default_ environment variables (#48)
Browse files Browse the repository at this point in the history
now use the aws_default_region and aws_default_profile environment variables if aws_region and aws_profile are not set

fix #42 #31
  • Loading branch information
corymhall authored Aug 13, 2021
1 parent 57b11be commit 6622a13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/assume-role-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ export class AssumeRoleCredentialProviderSource implements cdk.CredentialProvide
}).load();

logging.setLogLevel(yargs.argv.verbose as number)

// Set environment variables so JS AWS SDK behaves as close as possible to AWS CLI.
if (process.env.AWS_DEFAULT_PROFILE && !process.env.AWS_PROFILE) {
process.env.AWS_PROFILE = process.env.AWS_DEFAULT_PROFILE;
}
if (process.env.AWS_DEFAULT_REGION && !process.env.AWS_REGION) {
process.env.AWS_REGION = process.env.AWS_DEFAULT_REGION;
}
}

/**
Expand Down

0 comments on commit 6622a13

Please # to comment.