-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
71 lines (61 loc) Β· 1.63 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
service: lojack
app: lojack
org: fedeiglesias
useDotenv: true
plugins:
- serverless-plugin-scripts
- serverless-s3-sync
- serverless-domain-manager
- serverless-offline
provider:
name: aws
runtime: nodejs12.x
logs:
restApi: false
lambdaHashingVersion: 20201221
apiGateway:
shouldStartNameWithService: true
custom:
domain:
id: "ZJKMN1QK0FD9S"
name: fedeiglesias.com
subdomain: lojack.fedeiglesias.com
certificateArn: arn:aws:acm:us-east-1:989257975727:certificate/735f4bd6-85db-4cd6-89a2-dcec2bec7d49
# Bucket name
s3Bucket: ${self:service}-bucket-client
s3Sync:
- bucketName: ${self:custom.s3Bucket}
localDir: dist
params:
- index.html:
CacheControl: "no-store, no-cache"
- service-worker.js:
CacheControl: "no-store, no-cache"
- manifest.json:
CacheControl: "no-store, no-cache"
scripts:
hooks:
# Recreate API Gateway & Route53 custom domain for API
"package:initialize": "sls delete_domain && sls create_domain"
# Build Client
"before:deploy:deploy": npm run build
customDomain:
domainName: api.${self:custom.domain.subdomain}
autoDomain: true
endpointType: "regional"
securityPolicy: tls_1_2
functions:
dashboardData:
handler: api/dashboard.data
memorySize: 128
description: Get Dashboard data
events:
- http:
path: data
method: get
cors: false
resources:
- ${file(aws/resources/s3-bucket.yml)}
- ${file(aws/resources/s3-policies.yml)}
- ${file(aws/resources/cf-distribution.yml)}
- ${file(aws/resources/dns-records.yml)}