-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathserverless.yml
More file actions
64 lines (59 loc) · 1.63 KB
/
serverless.yml
File metadata and controls
64 lines (59 loc) · 1.63 KB
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
service: polyfill
plugins:
- '@silvermine/serverless-plugin-cloudfront-lambda-edge'
provider:
name: aws
runtime: nodejs10.x
stage: ${opt:stage, 'production'}
region: us-east-1
package:
exclude:
- server.js
- coverage/
- test/
functions:
polyfill:
handler: handler.handle
lambdaAtEdge:
distribution: PolyfillDistribution
eventType: origin-request
resources:
Resources:
PolyfillBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${file(./serverless-env.yml):bucket.name}
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: error.html
PolyfillDistribution:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Aliases:
- ${file(./serverless-env.yml):distribution.alias}
DefaultCacheBehavior:
Compress: true
ForwardedValues:
Cookies:
Forward: none
Headers:
- User-Agent
QueryString: true
TargetOriginId: polyfill-lambda
ViewerProtocolPolicy: redirect-to-https
DefaultRootObject: index.html
Enabled: true
HttpVersion: http2
Origins:
- DomainName:
Fn::GetAtt:
- PolyfillBucket
- DomainName
Id: polyfill-lambda
S3OriginConfig:
OriginAccessIdentity: ""
ViewerCertificate:
AcmCertificateArn: ${file(./serverless-env.yml):distribution.cert-arn}
SslSupportMethod: sni-only