-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
162 lines (157 loc) · 6.13 KB
/
serverless.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
service: repairs-hub-frontend
provider:
name: aws
runtime: nodejs20.x
timeout: 30
region: eu-west-2
stage: ${opt:stage}
lambdaHashingVersion: 20201221
apiGateway:
shouldStartNameWithService: true
binaryMediaTypes:
- image/jpg
- multipart/form-data
tracing:
lambda: Active
apiGateway: true
logs:
restApi: true
package:
individually: true
exclude:
- ./**
functions:
repairs-hub-frontend:
name: ${self:service}-${self:provider.stage}
handler: src/lambda.handler
provisionedConcurrency: ${self:custom.provisionedConcurrency.${self:provider.stage}}
package:
include:
- src/lambda.js
- next.config.js
- public/**
- 'build/_next/BUILD_ID'
- 'build/_next/*.json'
- 'build/_next/server/**'
- 'build/_next/static/**'
- node_modules/**
- '!node_modules/@next/swc-darwin-arm64'
- '!node_modules/@next/swc-darwin-x64'
- '!node_modules/@next/swc-linux-x64-gnu'
- '!node_modules/@next/swc-win32-x64-msvc'
- '!node_modules/@sentry/cli/sentry-cli'
- '!node_modules/leaflet'
events:
- http: ANY /
- http: ANY /{proxy+}
vpc:
securityGroupIds: ${self:custom.securityGroups.${self:provider.stage}}
subnetIds: ${self:custom.subnets.${self:provider.stage}}
environment:
S3_BUCKET_NAME: repairs-api-images-${self:provider.stage}
AGENTS_GOOGLE_GROUPNAME_REGEX: ${ssm:/repairs-hub/${self:provider.stage}/agents-group-regex}
AUTHORISATION_MANAGERS_GOOGLE_GROUPNAME: ${ssm:/repairs-hub/${self:provider.stage}/authorisation-managers-group}
BUDGET_CODE_OFFICER_GOOGLE_GROUPNAME: ${ssm:/repairs-hub/${self:provider.stage}/budget-code-officer-group}
DATA_ADMIN_GOOGLE_GROUPNAME: ${ssm:/repairs-hub/${self:provider.stage}/data-admin-group}
CONFIGURATION_API_URL: ${ssm:/repairs-hub/${self:provider.stage}/configuration-api-url}
CONTACT_DETAILS_API_URL: ${ssm:/repairs-hub/${self:provider.stage}/contact-details-api-url}
CONTRACT_MANAGERS_GOOGLE_GROUPNAME: ${ssm:/repairs-hub/${self:provider.stage}/contract-managers-group}
CONTRACTORS_GOOGLE_GROUPNAME_REGEX: ${ssm:/repairs-hub/${self:provider.stage}/contractors-group-regex}
DRS_WEB_SERVICES_PASSWORD: ${ssm:/repairs-hub/${self:provider.stage}/drs-password}
DRS_WEB_SERVICES_URL: ${ssm:/repairs-hub/${self:provider.stage}/drs-url}
DRS_WEB_SERVICES_USERNAME: ${ssm:/repairs-hub/${self:provider.stage}/drs-login}
GSSO_TOKEN_NAME: ${ssm:/repairs-hub/${self:provider.stage}/gsso-token-name}
GSSO_URL: ${ssm:/repairs-hub/${self:provider.stage}/gsso-url}
HACKNEY_JWT_SECRET: ${ssm:/repairs-hub/${self:provider.stage}/hackney-jwt-secret}
NODE_ENV: production
OPERATIVES_GOOGLE_GROUPNAME: ${ssm:/repairs-hub/${self:provider.stage}/operatives-group}
REDIRECT_URL: ${ssm:/repairs-hub/${self:provider.stage}/redirect-url}
REPAIRS_SERVICE_API_KEY: ${ssm:/repairs-hub/${self:provider.stage}/repairs-service-api-key}
REPAIRS_SERVICE_API_URL: ${ssm:/repairs-hub/${self:provider.stage}/repairs-service-api-url}
SENTRY_DSN: ${ssm:/repairs-hub/${self:provider.stage}/sentry-dsn}
SENTRY_ENVIRONMENT: ${self:provider.stage}
SENTRY_RELEASE: ${env:CIRCLE_SHA1}
FOLLOW_ON_FUNCTIONALITY_ENABLED: ${ssm:/repairs-hub/${self:provider.stage}/repairs-hub-enable-followon-functionality}
PAST_WORK_ORDERS_ENABLED: ${ssm:/repairs-hub/${self:provider.stage}/repairs-hub-enable-past-workorders-functionality}
FETCH_APPOINTMENTS_FROM_DRS: ${ssm:/repairs-hub/${self:provider.stage}/enable-fetch-appointments-from-drs}
resources:
Resources:
CloudFrontDistribution:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Aliases:
- ${self:custom.aliases.${self:provider.stage}}
PriceClass: PriceClass_100
ViewerCertificate:
AcmCertificateArn: ${self:custom.certificate-arn.${self:provider.stage}}
MinimumProtocolVersion: TLSv1.2_2018
SslSupportMethod: sni-only
DefaultCacheBehavior:
TargetOriginId: ${self:service}-${self:provider.stage}-custom-origin
ViewerProtocolPolicy: 'redirect-to-https'
AllowedMethods:
- GET
- HEAD
- OPTIONS
- PUT
- PATCH
- POST
- DELETE
DefaultTTL: 0
MaxTTL: 0
MinTTL: 0
ForwardedValues:
QueryString: true
Cookies:
Forward: all
Enabled: true
Origins:
- Id: ${self:service}-${self:provider.stage}-custom-origin
DomainName: ${self:custom.domain-name}
OriginPath: /${self:provider.stage}
CustomOriginConfig:
HTTPPort: 80
HTTPSPort: 443
OriginProtocolPolicy: https-only
staticImagesBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: repairs-hub-${opt:stage}-static-images
custom:
domain-name:
Fn::Join:
- '.'
- - Ref: ApiGatewayRestApi
- execute-api
- eu-west-2
- amazonaws.com
aliases:
development: repairs-hub-development.hackney.gov.uk
staging: repairs-hub-staging.hackney.gov.uk
production: repairs-hub.hackney.gov.uk
certificate-arn:
development: arn:aws:acm:us-east-1:364864573329:certificate/fc2125d7-c8b7-4837-8f68-ffa62c1dec54
staging: arn:aws:acm:us-east-1:715003523189:certificate/11327e5e-53d3-4b21-a613-f12ee0bed68d
production: arn:aws:acm:us-east-1:282997303675:certificate/852490a1-103e-41a9-bb86-79ecd88f2304
securityGroups:
development:
- sg-08e28776da7918e4b
staging:
- sg-0166cbf56b7e77af0
production:
- sg-0c40b8cfd2d03c359
subnets:
development:
- subnet-0140d06fb84fdb547
- subnet-05ce390ba88c42bfd
staging:
- subnet-06d3de1bd9181b0d7
- subnet-0ed7d7713d1127656
production:
- subnet-0beb266003a56ca82
- subnet-06a697d86a9b6ed01
provisionedConcurrency:
development: 0
staging: 0
production: 25