-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): cross account asset upload no longer works (#12155)
cdk_asset asset handlers use IAws to make calls to AWS APIs to discover information about target environment: account id, region, partition. Each asset is described by its manifest in a Cloud Assembly. This manifest can contain placeholders to resolve by asset handlers when publishing assets. Previously `${Aws::Partition}` placeholder was derived from a code path used to resolve `${Aws::AccountId}`, which was introducing a cyclic dependency for cross account deployments: - to replace partition placeholder it was assuming role in a target account to discover partition - to assume role in a target account it needs to know full role ARN to assume - role ARN contains partition placeholder It was working for same account deployments and for non environment aware deployments, because SdkProvider was always using current default (ambient) credentials without making `AssumeRole` call, thus it was able to replace placeholders in asset manifest without introducing a cyclic dependency. To fix cross account deployments we introduce `IAWS.discoverPartition()` method to return partition of default (ambient) credentials `cdk deploy` is called with. This works, because cross partition `AssumeRole` calls are not possible, therefore it's enough to know our default credentials partition. Fixes #12151 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
5 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters