Skip to content

Commit dc29eee

Browse files
fix(core): Using RoleName defined in Configuration for master CfnExecutionRole (aws-samples#576)
* Creating Accelerator Execution Role in all accounts * Adding Cloudformation service to assume pipelinerole * Setting maxConcurrency for installing pipeline roles to 40 * using role name specified in config for cfnstackset role * Fix passing param name
1 parent 6e5fe96 commit dc29eee

File tree

2 files changed

+11
-56
lines changed

2 files changed

+11
-56
lines changed
Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2+
"Parameters": {
3+
"RoleName": {
4+
"Type": "String"
5+
}
6+
},
27
"Resources": {
38
"AWSCloudFormationStackSetExecutionRole46A74E25": {
49
"Type": "AWS::IAM::Role",
@@ -44,66 +49,13 @@
4449
]
4550
}
4651
],
47-
"RoleName": "AWSCloudFormationStackSetExecutionRole"
52+
"RoleName": {
53+
"Ref": "RoleName"
54+
}
4855
},
4956
"Metadata": {
5057
"aws:cdk:path": "TestNewStack/AWSCloudFormationStackSetExecutionRole/Resource"
5158
}
52-
},
53-
"AWSCloudFormationStackSetAdministrationRole84528B57": {
54-
"Type": "AWS::IAM::Role",
55-
"Properties": {
56-
"AssumeRolePolicyDocument": {
57-
"Statement": [
58-
{
59-
"Action": "sts:AssumeRole",
60-
"Effect": "Allow",
61-
"Principal": {
62-
"Service": "cloudformation.amazonaws.com"
63-
}
64-
}
65-
],
66-
"Version": "2012-10-17"
67-
},
68-
"RoleName": "AWSCloudFormationStackSetAdministrationRole"
69-
},
70-
"Metadata": {
71-
"aws:cdk:path": "TestNewStack/AWSCloudFormationStackSetAdministrationRole/Resource"
72-
}
73-
},
74-
"AWSCloudFormationStackSetExecutionRolePolicyDBA04E55": {
75-
"Type": "AWS::IAM::Policy",
76-
"Properties": {
77-
"PolicyDocument": {
78-
"Statement": [
79-
{
80-
"Action": "sts:AssumeRole",
81-
"Effect": "Allow",
82-
"Resource": {
83-
"Fn::Join": [
84-
"",
85-
[
86-
"arn:*:iam::*:role/",
87-
{
88-
"Ref": "AWSCloudFormationStackSetExecutionRole46A74E25"
89-
}
90-
]
91-
]
92-
}
93-
}
94-
],
95-
"Version": "2012-10-17"
96-
},
97-
"PolicyName": "AWSCloudFormationStackSetExecutionRolePolicyDBA04E55",
98-
"Roles": [
99-
{
100-
"Ref": "AWSCloudFormationStackSetAdministrationRole84528B57"
101-
}
102-
]
103-
},
104-
"Metadata": {
105-
"aws:cdk:path": "TestNewStack/AWSCloudFormationStackSetExecutionRolePolicy/Resource"
106-
}
10759
}
10860
}
10961
}

src/core/cdk/src/initial-setup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,9 @@ export namespace InitialSetup {
387387
s3BucketName: installCfnRoleMasterTemplate.s3BucketName,
388388
s3ObjectKey: installCfnRoleMasterTemplate.s3ObjectKey,
389389
},
390+
stackParameters: {
391+
'RoleName.$': '$.configuration.organizationAdmiRole',
392+
},
390393
}),
391394
resultPath: 'DISCARD',
392395
},

0 commit comments

Comments
 (0)