This repository has been archived by the owner on Feb 17, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
77 lines (70 loc) · 1.97 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
service: serverless-cdn
provider:
name: aws
runtime: nodejs10.x
stage: ${opt:stage, 'dev'}
region: us-east-1
versionFunctions: false
logRetentionInDays: 3
deploymentBucket:
serverSideEncryption: AES256
blockPublicAccess: true
stackTags: ${self:custom.config.tags}
package:
individually: true
excludeDevDependencies: true
plugins:
- serverless-finch
- serverless-webpack
custom:
config: ${file(./stages/${self:provider.stage}.yml)}
client:
bucketName: '${self:custom.config.domain}'
distributionFolder: dist
indexDocument: 'index.html'
errorDocument: 'index.html'
manageResources: false
objectHeaders:
ALL_OBJECTS:
- name: 'Cache-Control'
value: 'max-age=2628000, public' # 1 month in seconds
'index.html': # https://stackoverflow.com/a/2068407
- name: 'Cache-Control'
value: 'no-cache, no-store, must-revalidate, max-age=0'
- name: Pragma
value: 'no-cache'
- name: Expires
value: '0'
sse: AES256
uploadOrder:
- .*
- index\.html
webpack:
includeModules:
forceExclude:
- aws-sdk
packager: npm
functions:
defaultIndex:
name: '${self:service}-${self:provider.stage}-origin-request-defaultIndex'
handler: functions/default_index.handler
description: CloudFront origin-request default index handler
timeout: 1 # seconds
memorySize: 128 # megabytes
events:
- cloudFront:
eventType: origin-request
webSecurity:
name: '${self:service}-${self:provider.stage}-origin-response-webSecurity'
handler: functions/web_security.handler
description: CloudFront origin-response web security handler
timeout: 1 # seconds
memorySize: 128 # megabytes
events:
- cloudFront:
eventType: origin-response
resources:
- ${file(resources/acm_cf.yml)}
- ${file(resources/cloudfront_cf.yml)}
- ${file(resources/route53_cf.yml)}
- ${file(resources/s3_cf.yml)}