@@ -308,6 +308,7 @@ Resources:
308308 RepositoryDescription: Configuration for Customizations for AWS Control Tower solution
309309 RepositoryName: !Ref CodeCommitRepositoryName
310310 Code:
311+ BranchName: !Ref CodeCommitBranchName
311312 S3:
312313 Bucket: !Sub %TEMPLATE_BUCKET_NAME%
313314 Key: !Sub %SOLUTION_NAME%/%VERSION%/custom-control-tower-configuration-${AWS::Region}.zip
@@ -1204,14 +1205,14 @@ Resources:
12041205 - cloudformation:UpdateStackInstances
12051206 - cloudformation:TagResource
12061207 - cloudformation:ListStackInstances
1207- - cloudformation:GetTemplateSummary
12081208 - cloudformation:DescribeStacks
12091209 Resource:
12101210 - !Sub arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/*
12111211 - !Sub arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stackset/*
12121212 - Effect: Allow
12131213 Action:
12141214 - cloudformation:ValidateTemplate
1215+ - cloudformation:GetTemplateSummary
12151216 Resource: '*'
12161217 - PolicyName: State-Machine-Lambda-Policy-SSM
12171218 PolicyDocument:
@@ -2188,23 +2189,7 @@ Resources:
21882189 "TimeoutSeconds": 300,
21892190 "HeartbeatSeconds": 60,
21902191 "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?"
22082193 },
22092194 "Skip Update StackSet?": {
22102195 "Type": "Choice",
@@ -3118,10 +3103,10 @@ Resources:
31183103 RoleArn: !GetAtt CustomControlTowerPipelineTriggerRole.Arn
31193104
31203105 # Cloudwatch Event Rule for Lifecycle Event (LE): triggered by LE events and send events to SQS
3121- CustomControlTowerLECWEventRule :
3106+ CustomControlTowerCreateManagedAccountCWEventRule :
31223107 Type: AWS::Events::Rule
31233108 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
31253110 EventPattern:
31263111 {
31273112 "detail-type": [
@@ -3150,6 +3135,38 @@ Resources:
31503135 SqsParameters:
31513136 MessageGroupId: CustomControlTower_Lifecycle_Event
31523137
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+
31533170 # Lifecycle event SQS Policy
31543171 CustomControlTowerLEQueuePolicy:
31553172 Type: AWS::SQS::QueuePolicy
@@ -3166,7 +3183,9 @@ Resources:
31663183 Resource: !GetAtt CustomControlTowerLEFIFOQueue.Arn
31673184 Condition:
31683185 ArnEquals:
3169- aws:SourceArn: !GetAtt CustomControlTowerLECWEventRule.Arn
3186+ aws:SourceArn:
3187+ - !GetAtt CustomControlTowerCreateManagedAccountCWEventRule.Arn
3188+ - !GetAtt CustomControlTowerUpdateManagedAccountCWEventRule.Arn
31703189
31713190Outputs:
31723191 CustomControlTowerCodePipeline:
0 commit comments