-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathserverless.yml
100 lines (85 loc) · 2.54 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
service: mmt
frameworkVersion: '3'
useDotenv: true
provider:
name: aws
runtime: nodejs18.x
versionFunctions: false
stage: ${opt:stage, 'dev'}
region: us-east-1
endpointType: PRIVATE
environment:
COLLECTION_TEMPLATES_BUCKET_NAME: ${self:custom.collectionTemplatesBucketName}
EDL_PASSWORD: ${env:EDL_PASSWORD, ''}
COOKIE_DOMAIN: ${env:COOKIE_DOMAIN, '.localhost'}
JWT_SECRET: ${env:JWT_SECRET, 'local-secret'}
JWT_VALID_TIME: ${env:JWT_VALID_TIME, '900'}
GTM_PROPERTY_ID: ${env:GTM_PROPERTY_ID, ''}
vpc:
securityGroupIds:
- Fn::ImportValue: ${self:provider.stage}-LambdaSecurityGroup
subnetIds:
- ${env:SUBNET_ID_A, 'subnetIdA'}
- ${env:SUBNET_ID_B, 'subnetIdB'}
- ${env:SUBNET_ID_C, 'subnetIdC'}
# Prevent Serverless from attempting to modify the deployment bucket policy as NGAP does not allow it
deploymentBucket:
skipPolicySetup: true
# Package each lambda into individual zip files. This reduces the size of
# each lambda but increases the complexity of the compilation process slightly
package:
individually: true
configValidationMode: error
#
# Lambda Functions
#
functions: ${file(./serverless-configs/${self:provider.name}-functions.yml)}
#
# Additional AWS Resources
#
resources: ${file(./serverless-configs/${self:provider.name}-resources.yml)}
plugins:
- serverless-esbuild
- serverless-finch
- serverless-offline
- serverless-s3-local
custom:
siteName: mmt-${self:provider.stage}
collectionTemplatesBucketName: ${self:custom.siteName}-collection-templates
infrastructureStackName: mmt-infrastructure-${self:provider.stage}
# Finch (S3 sync plugin)
client:
bucketName: ${self:custom.siteName}
distributionFolder: dist
objectHeaders:
index.html:
- name: Cache-Control
value: no-store
'*.css':
- name: Cache-Control
value: 'max-age=31536000'
'*.js':
- name: Cache-Control
value: 'max-age=31536000'
assets/:
- name: Cache-Control
value: 'max-age=31536000'
# Prevent the plugin from attempting to change the bucket policy
manageResources: false
# Default is 3000 so to avoid conflicts with rails applications we'll define a new port
serverless-offline:
httpPort: 4001
lambdaPort: 4003
allowCache: true
s3:
host: localhost
directory: tmp
# Don't minify the build in development
minifyBuild:
dev: false
sit: true
uat: true
prod: true
esbuild:
bundle: true
minify: ${self:custom.minifyBuild.${self:provider.stage}}