-
Notifications
You must be signed in to change notification settings - Fork 3
/
serverless.yml
77 lines (70 loc) · 1.8 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: logistics-guide
app: chaine
frameworkVersion: '3'
provider:
name: aws
runtime: nodejs14.x
lambdaHashingVersion: 20201221
region: us-east-1
memorySize: 1024
timeout: 60
logRetentionInDays: 7
plugins:
- serverless-finch
- serverless-s3-deploy
custom:
bucket:
name: chaine-the-ultimate-logistics-guide
client:
bucketName: ${self:custom.bucket.name}
distributionFolder: build
errorDocument: 404.html
sse: AES256
assets:
# Automatically copying public folder and distribution to S3 stopped working; we do it manually now
auto: false
targets:
- bucket: ${self:custom.bucket.name}
acl: public-read
files:
- source: build/
headers:
CacheControl: max-age=31104000 # 1 year
globs:
- '**/*'
resources:
Resources:
# S3 Bucket for the distribution bundles
DistBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Delete
Properties:
BucketName: ${self:custom.bucket.name}
AccessControl: Private
CorsConfiguration:
CorsRules:
- AllowedHeaders:
- '*'
AllowedMethods:
- 'GET'
AllowedOrigins:
- Fn::Join:
- ''
- - https://
- Ref: ApiGatewayRestApi
- .execute-api.
- Ref: AWS::Region
- .amazonaws.com
- Fn::Join:
- ''
- - https://chaineapp.com
MaxAge: 3000
Outputs:
ApiGatewayRestApi:
Description: API Gateway Endpoint
Value:
Ref: ApiGatewayRestApi
DistBucket:
Description: Distribution S3 Bucket
Value:
Ref: DistBucket