-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
128 lines (123 loc) · 4.69 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
service: housing-register-frontend
provider:
name: aws
runtime: nodejs20.x
versionFunctions: false
region: eu-west-2
stage: ${opt:stage}
package:
individually: true
exclude:
- ./**
functions:
housing-register-frontend:
name: ${self:service}-${self:provider.stage}
handler: lambda.handler
timeout: 30
package:
patterns:
- lambda.js
- next.config.js
- pages/**
- public/**
- build/_next/**
- '!build/_next/cache/**'
- node_modules/**
events:
- http: ANY /
- http: ANY /{proxy+}
vpc:
securityGroupIds: ${self:custom.securityGroups.${self:provider.stage}}
subnetIds: ${self:custom.subnets.${self:provider.stage}}
environment:
ACTIVITY_HISTORY_API: ${ssm:/housing-register/${self:provider.stage}/activity-history-api-url}
APP_URL: ${ssm:/housing-register/${self:provider.stage}/app-url}
AUTHORISED_ADMIN_GROUP: ${ssm:/housing-register/${self:provider.stage}/authorised_admin_group}
AUTHORISED_MANAGER_GROUP: ${ssm:/housing-register/${self:provider.stage}/authorised_manager_group}
AUTHORISED_OFFICER_GROUP: ${ssm:/housing-register/${self:provider.stage}/authorised_officer_group}
AUTHORISED_READONLY_GROUP: ${ssm:/housing-register/${self:provider.stage}/authorised_readonly_group}
HACKNEY_JWT_SECRET: ${ssm:/housing-register/${self:provider.stage}/hackney-jwt-secret}
HOUSING_REGISTER_API: ${ssm:/housing-register/${self:provider.stage}/housing-register-api-url}
HOUSING_REGISTER_KEY: ${ssm:/housing-register/${self:provider.stage}/housing-register-api-key}
LOOKUP_API_URL: ${ssm:/housing-register/${self:provider.stage}/lookup-api-url}
LOOKUP_API_TOKEN: ${ssm:/housing-register/${self:provider.stage}/lookup-api-key}
NEXT_PUBLIC_ENV: ${opt:stage}
NEXT_PUBLIC_EVIDENCE_STORE: ${ssm:/housing-register/${self:provider.stage}/evidence-store-url}
NOTIFY_API_KEY: ${ssm:/housing-register/${self:provider.stage}/notify-api-key}
NOTIFY_TEMPLATE_NEW_APPLICATION: ${ssm:/housing-register/${self:provider.stage}/notify-template-new-application}
NOTIFY_TEMPLATE_DISQUALIFY: ${ssm:/housing-register/${self:provider.stage}/notify-template-disqualify}
NOTIFY_TEMPLATE_MEDICAL_NEED: ${ssm:/housing-register/${self:provider.stage}/notify-template-medical-need}
SKIP_VERIFY_TOKEN: false
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
custom:
domain-name:
Fn::Join:
- '.'
- - Ref: ApiGatewayRestApi
- execute-api
- eu-west-2
- amazonaws.com
aliases:
development: housing-register-development.hackney.gov.uk
staging: housing-register-staging.hackney.gov.uk
production: housing-register.hackney.gov.uk
certificate-arn:
development: arn:aws:acm:us-east-1:364864573329:certificate/955e7d76-1147-4102-9179-8880641875eb
staging: arn:aws:acm:us-east-1:087586271961:certificate/5a0d62b9-688d-4a24-8cfe-fbb45b893fb5
production: arn:aws:acm:us-east-1:282997303675:certificate/e0a3cc0b-024c-4009-bc2e-69c36d918d61
securityGroups:
development:
- sg-0de8a8ee9797b9e47
staging:
- sg-01f034186031943c1
production:
- sg-0326e27e3d605c143
subnets:
development:
- subnet-0140d06fb84fdb547
- subnet-05ce390ba88c42bfd
staging:
- subnet-0ea0020a44b98a2ca
- subnet-0743d86e9b362fa38
production:
- subnet-0beb266003a56ca82
- subnet-06a697d86a9b6ed01