@@ -90,7 +90,19 @@ Resources:
9090 - LAMBDA_INSIDE_VPC
9191 - LAMBDA_CONCURRENCY_CHECK
9292
93- FHIRValidatorNHSDigitalResources :
93+ SecurityGroupWithoutEgress :
94+ Type : AWS::EC2::SecurityGroup
95+ Properties :
96+ GroupDescription : Limits security group egress traffic
97+ SecurityGroupEgress :
98+ - CidrIp : 127.0.0.1/32
99+ IpProtocol : " -1"
100+ SecurityGroupIngress :
101+ - CidrIp : 0.0.0.0/0
102+ IpProtocol : " -1"
103+ VpcId : !ImportValue vpc-resources:VpcId
104+
105+ FHIRValidatorNHSDigitalLegacyResources :
94106 Type : AWS::Serverless::Application
95107 Properties :
96108 Location : lambda_resources.yaml
@@ -100,30 +112,69 @@ Resources:
100112 SplunkSubscriptionFilterRole : !ImportValue lambda-resources:SplunkSubscriptionFilterRole
101113 SplunkDeliveryStream : !ImportValue lambda-resources:SplunkDeliveryStream
102114 EnableSplunk : " true"
103- LambdaName : !Sub "${AWS::StackName}-FHIRValidatorNHSDigital "
104- LambdaArn : !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-FHIRValidatorNHSDigital
115+ LambdaName : !Sub "${AWS::StackName}-FHIRValidatorNHSDigitalLegacy "
116+ LambdaArn : !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-FHIRValidatorNHSDigitalLegacy
105117 LogRetentionDays : !Ref LogRetentionDays
106- ExecutePolicyExportName : FHIRValidatorNHSDigitalExecuteLambdaPolicyArn
118+ ExecutePolicyExportName : FHIRValidatorNHSDigitalLegacyExecuteLambdaPolicyArn
107119
108- sgwithoutegress :
109- Type : AWS::EC2::SecurityGroup
120+ FHIRValidatorNHSDigitalLegacy :
121+ Type : AWS::Serverless::Function
110122 Properties :
111- GroupDescription : Limits security group egress traffic
112- SecurityGroupEgress :
113- - CidrIp : 127.0.0.1/32
114- IpProtocol : " -1"
115- SecurityGroupIngress :
116- - CidrIp : 0.0.0.0/0
117- IpProtocol : " -1"
118- VpcId : vpc-078cd165c7acf6f63
123+ FunctionName : !Sub "${AWS::StackName}-FHIRValidatorNHSDigitalLegacy"
124+ CodeUri : ../
125+ Handler : software.nhs.fhirvalidator.handler.HandlerStream::handleRequest
126+ Role : !GetAtt FHIRValidatorNHSDigitalLegacyResources.Outputs.LambdaRoleArn
127+ SnapStart :
128+ ApplyOn : PublishedVersions
129+ AutoPublishAlias : snap
130+ Timeout : 600
131+ MemorySize : 4096
132+ Architectures :
133+ - x86_64
134+ Runtime : java21
135+ Layers :
136+ - !Sub " arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension:56"
137+ VpcConfig :
138+ SecurityGroupIds :
139+ - !Ref SecurityGroupWithoutEgress
140+ SubnetIds :
141+ - !ImportValue vpc-resources:PrivateSubnetA
142+ - !ImportValue vpc-resources:PrivateSubnetB
143+ - !ImportValue vpc-resources:PrivateSubnetC
144+ Environment :
145+ Variables :
146+ AWS_LAMBDA_LOG_LEVEL : !Ref LogLevel
147+ POWERTOOLS_LOG_LEVEL : !Ref LogLevel
148+ PROFILE_MANIFEST_FILE : nhs_digital.manifest.json
149+ Metadata :
150+ BuildMethod : makefile
151+ guard :
152+ SuppressedRules :
153+ - LAMBDA_DLQ_CHECK
154+ - LAMBDA_CONCURRENCY_CHECK
119155
120- FHIRValidatorNHSDigital :
156+ FHIRValidatorNHSDigitalCurrentResources :
157+ Type : AWS::Serverless::Application
158+ Properties :
159+ Location : lambda_resources.yaml
160+ Parameters :
161+ StackName : !Ref AWS::StackName
162+ CloudWatchKMSKey : !ImportValue account-resources:CloudwatchLogsKmsKeyArn
163+ SplunkSubscriptionFilterRole : !ImportValue lambda-resources:SplunkSubscriptionFilterRole
164+ SplunkDeliveryStream : !ImportValue lambda-resources:SplunkDeliveryStream
165+ EnableSplunk : " true"
166+ LambdaName : !Sub "${AWS::StackName}-FHIRValidatorNHSDigitalCurrent"
167+ LambdaArn : !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-FHIRValidatorNHSDigitalCurrent
168+ LogRetentionDays : !Ref LogRetentionDays
169+ ExecutePolicyExportName : FHIRValidatorNHSDigitalCurrentExecuteLambdaPolicyArn
170+
171+ FHIRValidatorNHSDigitalCurrent :
121172 Type : AWS::Serverless::Function
122173 Properties :
123- FunctionName : !Sub "${AWS::StackName}-FHIRValidatorNHSDigital "
174+ FunctionName : !Sub "${AWS::StackName}-FHIRValidatorNHSDigitalCurrent "
124175 CodeUri : ../
125176 Handler : software.nhs.fhirvalidator.handler.HandlerStream::handleRequest
126- Role : !GetAtt FHIRValidatorNHSDigitalResources .Outputs.LambdaRoleArn
177+ Role : !GetAtt FHIRValidatorNHSDigitalCurrentResources .Outputs.LambdaRoleArn
127178 SnapStart :
128179 ApplyOn : PublishedVersions
129180 AutoPublishAlias : snap
@@ -136,11 +187,11 @@ Resources:
136187 - !Sub " arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension:56"
137188 VpcConfig :
138189 SecurityGroupIds :
139- - !Ref sgwithoutegress
190+ - !Ref SecurityGroupWithoutEgress
140191 SubnetIds :
141- - subnet-0df16e0ac5f81607f
142- - subnet-0fee41653b358c179
143- - subnet-02f13219e4528459b
192+ - !ImportValue vpc-resources:PrivateSubnetA
193+ - !ImportValue vpc-resources:PrivateSubnetB
194+ - !ImportValue vpc-resources:PrivateSubnetC
144195 Environment :
145196 Variables :
146197 AWS_LAMBDA_LOG_LEVEL : !Ref LogLevel
@@ -169,24 +220,59 @@ Outputs:
169220 Export :
170221 Name :
171222 !Join [":", [!Ref "AWS::StackName", "FHIRValidatorUKCoreLambdaName"]]
223+
172224 FHIRValidatorUKCoreLambdaArn :
173225 Description : Arn of the FHIR validator UK Core lambda
174226 Value : !GetAtt FHIRValidatorUKCore.Arn
175227 Export :
176228 Name : !Join [":", [!Ref "AWS::StackName", "FHIRValidatorUKCoreLambdaArn"]]
177229
178- FHIRValidatorNHSDigitalLambdaName :
179- Description : Name of the FHIR validator NHS Digital lambda
180- Value : !Ref FHIRValidatorNHSDigital
230+ FHIRValidatorNHSDigitalLegacyLambdaName :
231+ Description : Name of the FHIR validator NHS Digital lambda using legacy hapi fhir
232+ Value : !Ref FHIRValidatorNHSDigitalLegacy
181233 Export :
182234 Name :
183235 !Join [
184236 " :" ,
185- [!Ref "AWS::StackName", "FHIRValidatorNHSDigitalLambdaName"],
237+ [
238+ !Ref "AWS::StackName",
239+ " functions:FHIRValidatorNHSDigitalLegacy:Name" ,
240+ ],
186241 ]
187- FHIRValidatorNHSDigitalLambdaArn :
188- Description : Arn of the FHIR validator NHS Digital lambda
189- Value : !GetAtt FHIRValidatorNHSDigital.Arn
242+ FHIRValidatorNHSDigitalLegacyLambdaArn :
243+ Description : Arn of the FHIR validator NHS Digital lambda using legacy hapi fhir
244+ Value : !GetAtt FHIRValidatorNHSDigitalLegacy.Arn
245+ Export :
246+ Name :
247+ !Join [
248+ " :" ,
249+ [
250+ !Ref "AWS::StackName",
251+ " functions:FHIRValidatorNHSDigitalLegacy:Arn" ,
252+ ],
253+ ]
254+
255+ FHIRValidatorNHSDigitalCurrentLambdaName :
256+ Description : Name of the FHIR validator NHS Digital lambda using current hapi fhir
257+ Value : !Ref FHIRValidatorNHSDigitalCurrent
190258 Export :
191259 Name :
192- !Join [":", [!Ref "AWS::StackName", "FHIRValidatorNHSDigitalLambdaArn"]]
260+ !Join [
261+ " :" ,
262+ [
263+ !Ref "AWS::StackName",
264+ " functions:FHIRValidatorNHSDigitalCurrent:Name" ,
265+ ],
266+ ]
267+ FHIRValidatorNHSDigitalCurrentLambdaArn :
268+ Description : Arn of the FHIR validator NHS Digital lambda using current hapi fhir
269+ Value : !GetAtt FHIRValidatorNHSDigitalCurrent.Arn
270+ Export :
271+ Name :
272+ !Join [
273+ " :" ,
274+ [
275+ !Ref "AWS::StackName",
276+ " functions:FHIRValidatorNHSDigitalCurrent:Arn" ,
277+ ],
278+ ]
0 commit comments