Skip to content

Commit ec4f247

Browse files
authored
Change condition to deploy SourceS3 bucket to check for source account and data export (#286)
Looks great! Merging. Will release with few other changes asap
1 parent 6636fa9 commit ec4f247

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

data-exports/deploy/data-exports-aggregation.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ Conditions:
125125
- !Condition ManageCUR2
126126
- !Condition ManageFOCUS
127127
- !Condition ManageCOH
128+
DeploySourceS3:
129+
Fn::And:
130+
- !Condition IsSourceAccount
131+
- !Condition DeployDataExport
128132
DeployCOHServiceRole: !And [!Condition IsSourceAccount, !Condition ManageCOH]
129133
DeployCUR2ViaCFN: !And [!Condition IsSourceAccount, !Condition ManageCUR2, !Condition RegionSupportsDataExportsViaCFN]
130134
DeployFOCUSViaCFN: !And [!Condition IsSourceAccount, !Condition ManageFOCUS, !Condition RegionSupportsDataExportsViaCFN]
@@ -271,7 +275,7 @@ Resources:
271275

272276
SourceS3:
273277
Type: AWS::S3::Bucket
274-
Condition: DeployDataExport
278+
Condition: DeploySourceS3
275279
DeletionPolicy: Delete
276280
UpdateReplacePolicy: Delete
277281
Properties:
@@ -339,7 +343,7 @@ Resources:
339343

340344
SourceS3BucketPolicy:
341345
Type: 'AWS::S3::BucketPolicy'
342-
Condition: DeployDataExport
346+
Condition: DeploySourceS3
343347
DeletionPolicy: Delete
344348
UpdateReplacePolicy: Delete
345349
Properties:
@@ -384,7 +388,7 @@ Resources:
384388
aws:SourceAccount: !Ref AWS::AccountId
385389

386390
ReplicationRole:
387-
Condition: DeployDataExport
391+
Condition: DeploySourceS3
388392
Type: AWS::IAM::Role
389393
Properties:
390394
Path: !Sub /${ResourcePrefix}/
@@ -1522,7 +1526,7 @@ Outputs:
15221526
Value: !Join [ '_', !Split [ '-', !Sub '${ResourcePrefix}_data_export' ] ] # replace '-' to '_'
15231527
Export: { Name: 'cid-DataExports-Database'}
15241528
LocalAccountBucket:
1525-
Condition: DeployDataExport
1529+
Condition: DeploySourceS3
15261530
Description: Local Bucket Name which replicate objects to centralized bucket
15271531
Value: !Sub ${ResourcePrefix}-${AWS::AccountId}-data-local
15281532
ReadAccessPolicyARN:

0 commit comments

Comments
 (0)