@@ -308,6 +308,7 @@ Resources:
308
308
RepositoryDescription: Configuration for Customizations for AWS Control Tower solution
309
309
RepositoryName: !Ref CodeCommitRepositoryName
310
310
Code:
311
+ BranchName: !Ref CodeCommitBranchName
311
312
S3:
312
313
Bucket: !Sub %TEMPLATE_BUCKET_NAME%
313
314
Key: !Sub %SOLUTION_NAME%/%VERSION%/custom-control-tower-configuration-${AWS::Region}.zip
@@ -1204,14 +1205,14 @@ Resources:
1204
1205
- cloudformation:UpdateStackInstances
1205
1206
- cloudformation:TagResource
1206
1207
- cloudformation:ListStackInstances
1207
- - cloudformation:GetTemplateSummary
1208
1208
- cloudformation:DescribeStacks
1209
1209
Resource:
1210
1210
- !Sub arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/*
1211
1211
- !Sub arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stackset/*
1212
1212
- Effect: Allow
1213
1213
Action:
1214
1214
- cloudformation:ValidateTemplate
1215
+ - cloudformation:GetTemplateSummary
1215
1216
Resource: '*'
1216
1217
- PolicyName: State-Machine-Lambda-Policy-SSM
1217
1218
PolicyDocument:
@@ -2188,23 +2189,7 @@ Resources:
2188
2189
"TimeoutSeconds": 300,
2189
2190
"HeartbeatSeconds": 60,
2190
2191
"InputPath": "$",
2191
- "Next": "Check List StackInstances Accounts Complete?"
2192
- },
2193
- "Check List StackInstances Accounts Complete?": {
2194
- "Type": "Choice",
2195
- "Choices": [
2196
- {
2197
- "Variable": "$.NextToken",
2198
- "StringEquals": "Complete",
2199
- "Next": "Skip Update StackSet?"
2200
- }
2201
- ],
2202
- "Default": "Check List StackInstances Accounts Wait"
2203
- },
2204
- "Check List StackInstances Accounts Wait": {
2205
- "Type": "Wait",
2206
- "Seconds": 5,
2207
- "Next": "List StackInstances Accounts"
2192
+ "Next": "Skip Update StackSet?"
2208
2193
},
2209
2194
"Skip Update StackSet?": {
2210
2195
"Type": "Choice",
@@ -3118,10 +3103,10 @@ Resources:
3118
3103
RoleArn: !GetAtt CustomControlTowerPipelineTriggerRole.Arn
3119
3104
3120
3105
# Cloudwatch Event Rule for Lifecycle Event (LE): triggered by LE events and send events to SQS
3121
- CustomControlTowerLECWEventRule :
3106
+ CustomControlTowerCreateManagedAccountCWEventRule :
3122
3107
Type: AWS::Events::Rule
3123
3108
Properties:
3124
- Description: Custom Control Tower - Rule for lifecycle events from Control Tower Service
3109
+ Description: Trigger CFCT on CreateManagedAccount events from Control Tower Service
3125
3110
EventPattern:
3126
3111
{
3127
3112
"detail-type": [
@@ -3150,6 +3135,38 @@ Resources:
3150
3135
SqsParameters:
3151
3136
MessageGroupId: CustomControlTower_Lifecycle_Event
3152
3137
3138
+ CustomControlTowerUpdateManagedAccountCWEventRule:
3139
+ Type: AWS::Events::Rule
3140
+ Properties:
3141
+ Description: Trigger CFCT on UpdateManagedAccount events from Control Tower Service
3142
+ EventPattern:
3143
+ {
3144
+ "detail-type": [
3145
+ "AWS Service Event via CloudTrail"
3146
+ ],
3147
+ "source": [
3148
+ "aws.controltower"
3149
+ ],
3150
+ "detail": {
3151
+ "eventName": [
3152
+ "UpdateManagedAccount"
3153
+ ],
3154
+ "serviceEventDetails": {
3155
+ "updateManagedAccountStatus": {
3156
+ "state": [
3157
+ "SUCCEEDED"
3158
+ ]
3159
+ }
3160
+ }
3161
+ }
3162
+ }
3163
+ State: ENABLED
3164
+ Targets:
3165
+ - Arn: !GetAtt CustomControlTowerLEFIFOQueue.Arn
3166
+ Id: "CustomControlTower_Lifecycle_Event_FIFO_Queue"
3167
+ SqsParameters:
3168
+ MessageGroupId: CustomControlTower_Lifecycle_Event
3169
+
3153
3170
# Lifecycle event SQS Policy
3154
3171
CustomControlTowerLEQueuePolicy:
3155
3172
Type: AWS::SQS::QueuePolicy
@@ -3166,7 +3183,9 @@ Resources:
3166
3183
Resource: !GetAtt CustomControlTowerLEFIFOQueue.Arn
3167
3184
Condition:
3168
3185
ArnEquals:
3169
- aws:SourceArn: !GetAtt CustomControlTowerLECWEventRule.Arn
3186
+ aws:SourceArn:
3187
+ - !GetAtt CustomControlTowerCreateManagedAccountCWEventRule.Arn
3188
+ - !GetAtt CustomControlTowerUpdateManagedAccountCWEventRule.Arn
3170
3189
3171
3190
Outputs:
3172
3191
CustomControlTowerCodePipeline:
0 commit comments