-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
63 lines (58 loc) · 1.96 KB
/
serverless.yml
File metadata and controls
63 lines (58 loc) · 1.96 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
service: blockies-generator
plugins:
- "@silvermine/serverless-plugin-cloudfront-lambda-edge"
- serverless-plugin-include-dependencies
- serverless-dotenv-plugin
provider:
name: aws
runtime: nodejs8.10
region: us-east-1
functions:
blockiesGenerator:
name: 'blockies-generator'
handler: index.handler
memorySize: 128
timeout: 2
lambdaAtEdge:
distribution: 'BlockiesDistribtuion'
eventType: 'origin-request'
resources:
Resources:
BlockiesOriginAccessIdentity: # Only used for landing page assets
Type: AWS::CloudFront::CloudFrontOriginAccessIdentity
Properties:
CloudFrontOriginAccessIdentityConfig:
Comment: "CloudFrontOriginAccessIdentity for ${self:service}-${self:provider.stage}"
BlockiesDistribtuion:
Type: 'AWS::CloudFront::Distribution'
Properties:
DistributionConfig:
Aliases:
- ${env:BLOCKIES_DOMAIN}
DefaultRootObject: "index.html"
DefaultCacheBehavior:
TargetOriginId: 'BlockiesOrigin'
ViewerProtocolPolicy: 'redirect-to-https'
DefaultTTL: 31536000 # one year, default MaxTTL
Compress: true
ForwardedValues:
QueryString: true
QueryStringCacheKeys:
- size
Cookies:
Forward: 'none'
Enabled: true
PriceClass: 'PriceClass_200'
HttpVersion: 'http2'
ViewerCertificate:
AcmCertificateArn: ${env:ACM_CERTIFICATE_ARN}
SslSupportMethod: 'sni-only'
MinimumProtocolVersion: 'TLSv1.1_2016'
Origins:
- Id: 'BlockiesOrigin'
DomainName: 'blockies.shipchain.io.s3.amazonaws.com' # Only used for landing page assets
S3OriginConfig:
OriginAccessIdentity: { "Fn::Join" : ["", ["origin-access-identity/cloudfront/", { Ref: BlockiesOriginAccessIdentity } ] ] }
package:
exclude:
- "web"