-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain_template.yaml
More file actions
111 lines (106 loc) · 3.04 KB
/
main_template.yaml
File metadata and controls
111 lines (106 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
FHIR validator lambda
Parameters:
LogLevel:
Type: String
Description: The log level to set in the lambda
Default: "INFO"
LogRetentionDays:
Type: Number
Description: How long to keep logs for
Default: 30
AllowedValues:
[
1,
3,
5,
7,
14,
30,
60,
90,
120,
150,
180,
365,
400,
545,
731,
1096,
1827,
2192,
2557,
2922,
3288,
3653,
]
EnableAlerts:
Type: String
Default: true
AllowedValues:
- true
- false
Resources:
FHIRValidatorUKCoreResources:
Type: AWS::Serverless::Application
Properties:
Location: lambda_resources.yaml
Parameters:
StackName: !Ref AWS::StackName
CloudWatchKMSKey: !ImportValue account-resources:CloudwatchLogsKmsKeyArn
SplunkSubscriptionFilterRole: !ImportValue lambda-resources:SplunkSubscriptionFilterRole
SplunkDeliveryStream: !ImportValue lambda-resources:SplunkDeliveryStream
EnableSplunk: "true"
LambdaName: !Sub "${AWS::StackName}-FHIRValidatorUKCore"
LambdaArn: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-FHIRValidatorUKCore
LogRetentionDays: !Ref LogRetentionDays
FHIRValidatorUKCore:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub "${AWS::StackName}-FHIRValidatorUKCore"
CodeUri: ../
Handler: software.nhs.fhirvalidator.handler.HandlerStream::handleRequest
Role: !GetAtt FHIRValidatorUKCoreResources.Outputs.LambdaRoleArn
SnapStart:
ApplyOn: PublishedVersions
AutoPublishAlias: snap
Timeout: 600
MemorySize: 4096
Architectures:
- arm64
Runtime: java21
Layers:
- !Sub arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension-Arm64:20
Environment:
Variables:
AWS_LAMBDA_LOG_LEVEL: !Ref LogLevel
POWERTOOLS_LOG_LEVEL: !Ref LogLevel
PROFILE_MANIFEST_FILE: uk_core.manifest.json
Metadata:
guard:
SuppressedRules:
- LAMBDA_DLQ_CHECK
- LAMBDA_INSIDE_VPC
- LAMBDA_CONCURRENCY_CHECK
Alarms:
Type: AWS::Serverless::Application
Properties:
Location: alarms/main.yaml
Parameters:
StackName: !Ref AWS::StackName
EnableAlerts: !Ref EnableAlerts
FHIRValidatorUKCoreLambdaName: !Ref FHIRValidatorUKCore
Outputs:
FHIRValidatorUKCoreLambdaName:
Description: Name of the FHIR validator UK Core lambda
Value: !Ref FHIRValidatorUKCore
Export:
Name:
!Join [":", [!Ref "AWS::StackName", "FHIRValidatorUKCoreLambdaName"]]
FHIRValidatorUKCoreLambdaArn:
Description: Arn of the FHIR validator UK Core lambda
Value: !GetAtt FHIRValidatorUKCore.Arn
Export:
Name: !Join [":", [!Ref "AWS::StackName", "FHIRValidatorUKCoreLambdaArn"]]