Skip to content

Commit a64b01c

Browse files
fix(codepipeline): replace account root principal with current pipeline role in the trust policy under ff: @aws-cdk/pipelines:reduceStageRoleTrustScope (#33742)
### Issue # (if applicable) aws-codepipeline creates roles with broad trust policies. Closes #33709 ### Reason for this change Captured in Description of the issue. ### Description of changes 1. Introduced feature flag @aws-cdk/pipelines:reduceStageRoleTrustScope (default: true). 2. Under the feature flag when enabled, the root account principal will not be added to the trust policy of stage role. Instead the stage role can now be assumed by the current role created for the pipeline. ### Describe any new or updated permissions being added Described above. ### Description of how you validated changes integ test snapshots are being updated. ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5687d85 commit a64b01c

File tree

142 files changed

+31415
-15262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+31415
-15262
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.js.snapshot/appconfigconfigurationDefaultTestDeployAssert6752CD38.assets.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.js.snapshot/asset.3322b7049fb0ed2b7cbb644a2ada8d1116ff80c32dca89e6ada846b5de26f961.zip

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.js.snapshot/asset.e42a736be21cd3134b9bff4e71e3afa99a4cc900ae489e9a7f7025c8d258f9b8.zip

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.js.snapshot/aws-appconfig-configuration.assets.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.js.snapshot/aws-appconfig-configuration.template.json

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@
746746
"S3Bucket": {
747747
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
748748
},
749-
"S3Key": "3322b7049fb0ed2b7cbb644a2ada8d1116ff80c32dca89e6ada846b5de26f961.zip"
749+
"S3Key": "e42a736be21cd3134b9bff4e71e3afa99a4cc900ae489e9a7f7025c8d258f9b8.zip"
750750
},
751751
"Description": "/opt/awscli/aws"
752752
}
@@ -1807,19 +1807,9 @@
18071807
"Effect": "Allow",
18081808
"Principal": {
18091809
"AWS": {
1810-
"Fn::Join": [
1811-
"",
1812-
[
1813-
"arn:",
1814-
{
1815-
"Ref": "AWS::Partition"
1816-
},
1817-
":iam::",
1818-
{
1819-
"Ref": "AWS::AccountId"
1820-
},
1821-
":root"
1822-
]
1810+
"Fn::GetAtt": [
1811+
"MyPipelineRoleC0D47CA4",
1812+
"Arn"
18231813
]
18241814
}
18251815
}
@@ -1934,19 +1924,9 @@
19341924
"Effect": "Allow",
19351925
"Principal": {
19361926
"AWS": {
1937-
"Fn::Join": [
1938-
"",
1939-
[
1940-
"arn:",
1941-
{
1942-
"Ref": "AWS::Partition"
1943-
},
1944-
":iam::",
1945-
{
1946-
"Ref": "AWS::AccountId"
1947-
},
1948-
":root"
1949-
]
1927+
"Fn::GetAtt": [
1928+
"MyPipelineRoleC0D47CA4",
1929+
"Arn"
19501930
]
19511931
}
19521932
}

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.js.snapshot/integ.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)