Skip to content

Commit 2fa6e61

Browse files
AWSAWS
authored andcommitted
v2.7.0
1 parent b1ba765 commit 2fa6e61

Some content is hidden

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

66 files changed

+368
-2253
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
__pycache__
1313
.pytest_cache
1414
.mypy_cache
15+
.coverage
1516

1617
# Ignore virtual environments
1718
venv
@@ -21,6 +22,7 @@ testing-venv
2122
# Ignore installed dependencies
2223
dist
2324
source/src/build
25+
build
2426

2527
/deployment/open-source
2628
/deployment/state_machines/sample_events/

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.6.0
1+
v2.7.0

customizations-for-aws-control-tower.template

Lines changed: 56 additions & 37 deletions
Large diffs are not rendered by default.

deployment/build-s3-dist.sh

100755100644
File mode changed.

deployment/custom-control-tower-initiation.template

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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

31713190
Outputs:
31723191
CustomControlTowerCodePipeline:

deployment/run-unit-tests.sh

100755100644
File mode changed.

pytest.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[pytest]
2-
addopts = -v -ra -q -p source.tests.plugins.env_vars
2+
addopts = --verbose -ra -m unit
33
log_cli = true
44
log_level=WARN
55
markers =
66
unit
77
integration
88
e2e
9-

source/codebuild_scripts/execute_stage_scripts.sh

100755100644
File mode changed.

source/codebuild_scripts/install_stage_dependencies.sh

100755100644
File mode changed.

source/codebuild_scripts/run-validation.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ exit_shell_script() {
2727

2828
validate_template_file() {
2929
echo "Running aws cloudformation validate-template on $template_url"
30+
# TODO: Verify if this works if resource file is homed in opt-in region, and CT mgmt is homed in commercial region
3031
aws cloudformation validate-template --template-url "$template_url" --region "$AWS_REGION"
3132
if [ $? -ne 0 ]
3233
then

0 commit comments

Comments
 (0)