Skip to content

Commit 4eac959

Browse files
authored
2 parents b5c2189 + f350aeb commit 4eac959

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

CHANGELOG.v2.alpha.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.173.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.173.0-alpha.0...v2.173.1-alpha.0) (2024-12-14)
6+
57
## [2.173.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.172.0-alpha.0...v2.173.0-alpha.0) (2024-12-11)
68

79

CHANGELOG.v2.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.173.1](https://github.com/aws/aws-cdk/compare/v2.173.0...v2.173.1) (2024-12-14)
6+
7+
8+
### Bug Fixes
9+
10+
* **cli:** getting credentials via SSO fails when the region is set in the profile ([#32520](https://github.com/aws/aws-cdk/issues/32520)) ([01fec04](https://github.com/aws/aws-cdk/commit/01fec04ea8c0e33a406e6727801f8bc133a21196))
11+
512
## [2.173.0](https://github.com/aws/aws-cdk/compare/v2.172.0...v2.173.0) (2024-12-11)
613

714

packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts

+15
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ export class AwsCliCompatible {
3434
requestHandler: AwsCliCompatible.requestHandlerBuilder(options.httpOptions),
3535
customUserAgent: 'aws-cdk',
3636
logger: options.logger,
37+
};
38+
39+
// Super hacky solution to https://github.com/aws/aws-cdk/issues/32510, proposed by the SDK team.
40+
//
41+
// Summary of the problem: we were reading the region from the config file and passing it to
42+
// the credential providers. However, in the case of SSO, this makes the credential provider
43+
// use that region to do the SSO flow, which is incorrect. The region that should be used for
44+
// that is the one set in the sso_session section of the config file.
45+
//
46+
// The idea here: the "clientConfig" is for configuring the inner auth client directly,
47+
// and has the highest priority, whereas "parentClientConfig" is the upper data client
48+
// and has lower priority than the sso_region but still higher priority than STS global region.
49+
const parentClientConfig = {
3750
region: await this.region(options.profile),
3851
};
3952
/**
@@ -51,6 +64,7 @@ export class AwsCliCompatible {
5164
ignoreCache: true,
5265
mfaCodeProvider: tokenCodeFn,
5366
clientConfig,
67+
parentClientConfig,
5468
logger: options.logger,
5569
}));
5670
}
@@ -83,6 +97,7 @@ export class AwsCliCompatible {
8397
const nodeProviderChain = fromNodeProviderChain({
8498
profile: envProfile,
8599
clientConfig,
100+
parentClientConfig,
86101
logger: options.logger,
87102
mfaCodeProvider: tokenCodeFn,
88103
ignoreCache: true,

version.v2.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "2.173.0",
3-
"alphaVersion": "2.173.0-alpha.0"
2+
"version": "2.173.1",
3+
"alphaVersion": "2.173.1-alpha.0"
44
}

0 commit comments

Comments
 (0)