forked from dancinnamon-okta/secured-fhir-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.example.yml
166 lines (147 loc) · 4.39 KB
/
serverless.example.yml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# This is a reference example of a secured FHIR server using the latest HL7 implementation guides.
#Deploy this before your desired authorization servers.
service: secured-fhir-service
plugins:
- serverless-certificate-creator
- serverless-domain-manager
params:
default:
#The domain name you want publicly as the base domain name for the FHIR service.
FHIR_BASE_DOMAIN: fhir.your.tld
#Route53 hosted domain for FHIR service (include the period at the end)
FHIR_BASE_TLD: your.tld.
#Backend fhir service base FHIR_SERVICE_URL
BACKEND_FHIR_SERVICE_URL: http://your_fhir_base_url_here
#Backend signing algorithm for jwt
BACKEND_SIGNING_ALGORITHM: RS256
##Shouldn't have to touch anything below this line!##
provider:
name: aws
runtime: nodejs18.x
region: us-east-1
stage: dev
logs:
restApi: true
httpApi:
disableDefaultEndpoint: true
## Uncomment if your server is in AWS, and you wish to lock it down to a VPC.
# Note- this example deployment does not fully manage your VPC configuration in AWS.
# If you uncomment this, you'll need to decide how your Lambdas will get internet access
# and also how the Lambdas will access any internal AWS resources.
# vpc:
# securityGroupIds:
# - sg-youridhere
# subnetIds:
# - subnet-youridhere
environment:
FHIR_BASE_DOMAIN: ${param:FHIR_BASE_DOMAIN}
BACKEND_FHIR_SERVICE_URL: ${param:BACKEND_FHIR_SERVICE_URL}
BACKEND_SIGNING_ALGORITHM: ${param:BACKEND_SIGNING_ALGORITHM}
#Lambda functions
functions:
##Authorizer
globalFhirAuthorizer:
handler: ${self:provider.name}/fhirGlobalAuthorizer.handler
##METADATA ENDPOINTS
smart-config-endpoint:
handler: ${self:provider.name}/metadata_endpoints.smartConfigHandler
events:
- http:
path: /{tenantId}/smart-configuration
method: GET
cors: true
request:
parameters:
paths:
tenantId: true
- http:
path: /{tenantId}/.well-known/smart-configuration
method: GET
cors: true
request:
parameters:
paths:
tenantId: true
metadata-endpoint:
handler: ${self:provider.name}/metadata_endpoints.legacyMetadataHandler
events:
- http:
path: /{tenantId}/metadata
method: GET
cors: true
request:
parameters:
paths:
tenantId: true
udap-config-endpoint:
handler: ${self:provider.name}/metadata_endpoints.udapConfigHandler
events:
- http:
path: /{tenantId}/.well-known/udap
method: GET
cors: true
request:
parameters:
paths:
tenantId: true
#Patient match endpoint
patient-match-endpoint:
handler: ${self:provider.name}/match_operation.matchHandler
timeout: 30
events:
- http:
path: /{tenantId}/Patient/$match
method: POST
authorizer:
name: globalFhirAuthorizer
resultTtlInSeconds: 0
type: request
cors: true
request:
parameters:
paths:
tenantId: true
read-endpoint:
handler: ${self:provider.name}/read_operation.readHandler
timeout: 30
events:
- http:
path: /{tenantId}/{fhirResource}
method: GET
authorizer:
name: globalFhirAuthorizer
resultTtlInSeconds: 0
type: request
cors: true
request:
parameters:
paths:
tenantId: true
fhirResource: true
- http:
path: /{tenantId}/{fhirResource}/{proxy+}
method: GET
authorizer:
name: globalFhirAuthorizer
resultTtlInSeconds: 0
type: request
cors: true
request:
parameters:
paths:
tenantId: true
fhirResource: true
proxy: true
custom:
customCertificate:
certificateName: ${param:FHIR_BASE_DOMAIN}
hostedZoneNames: ${param:FHIR_BASE_TLD}
subjectAlternativeNames:
- ${param:FHIR_BASE_DOMAIN}
customDomain:
domainName: ${param:FHIR_BASE_DOMAIN}
certificateName: ${param:FHIR_BASE_DOMAIN}
basePath: ''
stage: ${self:provider.stage}
createRoute53Record: true
endpointType: regional