File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,15 @@ Parameters:
2929 3288,
3030 3653,
3131 ]
32+ AddDataExtractToAuditBucket :
33+ Type : String
34+ Description : Whether to add the data extract bucket as a source to the audit logging bucket policy
35+ AllowedValues :
36+ - " true"
37+ - " false"
38+
39+ Conditions :
40+ AddDataExtractToAuditBucketCondition : !Equals [!Ref AddDataExtractToAuditBucket, "true"]
3241
3342Resources :
3443 # region API Gateway
@@ -624,21 +633,24 @@ Resources:
624633 aws:SourceAccount : !Ref "AWS::AccountId"
625634 ArnLike :
626635 aws:SourceArn : !ImportValue "epsam:kbDocsBucket:Arn"
627- - Effect : Allow
628- Principal :
629- Service : logging.s3.amazonaws.com
630- Action :
631- - s3:PutObject*
632- Resource :
633- - !Join [
634- " " ,
635- [!GetAtt AuditLoggingBucket.Arn, "/data-extract/*"],
636- ]
637- Condition :
638- StringEquals :
639- aws:SourceAccount : !Ref "AWS::AccountId"
640- ArnLike :
641- aws:SourceArn : !ImportValue "data-extract:DestinationBucket:Arn"
636+ - !If
637+ - AddDataExtractToAuditBucketCondition
638+ - Effect : Allow
639+ Principal :
640+ Service : logging.s3.amazonaws.com
641+ Action :
642+ - s3:PutObject*
643+ Resource :
644+ - !Join [
645+ " " ,
646+ [!GetAtt AuditLoggingBucket.Arn, "/data-extract/*"],
647+ ]
648+ Condition :
649+ StringEquals :
650+ aws:SourceAccount : !Ref "AWS::AccountId"
651+ ArnLike :
652+ aws:SourceArn : !ImportValue "data-extract:DestinationBucket:Arn"
653+ - !Ref AWS::NoValue
642654
643655 # endregion
644656
Original file line number Diff line number Diff line change 114114 ]
115115 },
116116 "account-resources" : {
117- "LogRetentionDays" : " 90"
117+ "LogRetentionDays" : " 90" ,
118+ "AddDataExtractToAuditBucket" : " true"
118119 },
119120 "lambda-resources" : {
120121 "SplunkHECEndpoint" : " https://firehose.inputs.splunk.aws.digital.nhs.uk/services/collector/event" ,
Original file line number Diff line number Diff line change 77 " repo:NHSDigital/electronic-prescription-service-account-resources:environment:int-account" ,
88 " repo:NHSDigital/electronic-prescription-service-account-resources:environment:int-ci" ,
99 " repo:NHSDigital/electronic-prescription-service-account-resources:environment:int-lambda" ,
10+ " repo:NHSDigital/electronic-prescription-service-account-resources:environment:int" ,
1011 " repo:NHSDigital/electronic-prescription-service-clinical-prescription-tracker:environment:int" ,
1112 " repo:NHSDigital/eps-FHIR-validator-lambda:environment:int" ,
1213 " repo:NHSDigital/eps-prescription-status-update-api:environment:int" ,
7374 ]
7475 },
7576 "account-resources" : {
76- "LogRetentionDays" : " 90"
77+ "LogRetentionDays" : " 90" ,
78+ "AddDataExtractToAuditBucket" : " false"
7779 },
7880 "lambda-resources" : {
7981 "SplunkHECEndpoint" : " https://firehose.inputs.splunk.aws.digital.nhs.uk/services/collector/event" ,
Original file line number Diff line number Diff line change 77 " repo:NHSDigital/electronic-prescription-service-account-resources:environment:prod-account" ,
88 " repo:NHSDigital/electronic-prescription-service-account-resources:environment:prod-ci" ,
99 " repo:NHSDigital/electronic-prescription-service-account-resources:environment:prod-lambda" ,
10+ " repo:NHSDigital/electronic-prescription-service-account-resources:environment:prod" ,
1011 " repo:NHSDigital/electronic-prescription-service-clinical-prescription-tracker:environment:prod" ,
1112 " repo:NHSDigital/eps-FHIR-validator-lambda:environment:prod" ,
1213 " repo:NHSDigital/eps-prescription-status-update-api:environment:prod" ,
8384 ]
8485 },
8586 "account-resources" : {
86- "LogRetentionDays" : " 90"
87+ "LogRetentionDays" : " 90" ,
88+ "AddDataExtractToAuditBucket" : " false"
8789 },
8890 "lambda-resources" : {
8991 "SplunkHECEndpoint" : " https://firehose.inputs.splunk.aws.digital.nhs.uk/services/collector/event" ,
Original file line number Diff line number Diff line change 7272 ]
7373 },
7474 "account-resources" : {
75- "LogRetentionDays" : " 90"
75+ "LogRetentionDays" : " 90" ,
76+ "AddDataExtractToAuditBucket" : " true"
7677 },
7778 "lambda-resources" : {
7879 "SplunkHECEndpoint" : " https://firehose.inputs.splunk.aws.digital.nhs.uk/services/collector/event" ,
Original file line number Diff line number Diff line change 7575 ]
7676 },
7777 "account-resources" : {
78- "LogRetentionDays" : " 90"
78+ "LogRetentionDays" : " 90" ,
79+ "AddDataExtractToAuditBucket" : " false"
7980 },
8081 "lambda-resources" : {
8182 "SplunkHECEndpoint" : " https://firehose.inputs.splunk.aws.digital.nhs.uk/services/collector/event" ,
You can’t perform that action at this time.
0 commit comments