Skip to content

Commit

Permalink
Merge branch 'master' into benisrae/add-deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 20, 2020
2 parents 340f62d + 392675f commit d26c964
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export class AwsCliCompatible {
ec2creds: boolean | undefined,
containerCreds: boolean | undefined,
httpOptions: AWS.HTTPOptions | undefined) {
await forceSdkToReadConfigIfPresent();

profile = profile || process.env.AWS_PROFILE || process.env.AWS_DEFAULT_PROFILE || 'default';

Expand All @@ -46,10 +45,9 @@ export class AwsCliCompatible {
];

if (await fs.pathExists(credentialsFileName())) {
sources.push(() => new AWS.SharedIniFileCredentials({ profile, filename: credentialsFileName(), httpOptions, tokenCodeFn }));
}

if (await fs.pathExists(configFileName())) {
// Force reading the `config` file if it exists by setting the appropriate
// environment variable.
await forceSdkToReadConfigIfPresent();
sources.push(() => new AWS.SharedIniFileCredentials({ profile, filename: credentialsFileName(), httpOptions, tokenCodeFn }));
}

Expand Down Expand Up @@ -173,7 +171,7 @@ function configFileName() {
/**
* Force the JS SDK to honor the ~/.aws/config file (and various settings therein)
*
* For example, ther is just *NO* way to do AssumeRole credentials as long as AWS_SDK_LOAD_CONFIG is not set,
* For example, there is just *NO* way to do AssumeRole credentials as long as AWS_SDK_LOAD_CONFIG is not set,
* or read credentials from that file.
*
* The SDK crashes if the variable is set but the file does not exist, so conditionally set it.
Expand Down

0 comments on commit d26c964

Please sign in to comment.