-
Notifications
You must be signed in to change notification settings - Fork 13
/
serverless.yml
96 lines (90 loc) · 2.86 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
service: contact-tracing-api
provider:
name: aws
runtime: nodejs12.x
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'ap-northeast-1'}
logRetentionInDays: ${self:custom.LOG_RETENTION_IN_DAYS.${self:provider.stage}}
deploymentBucket:
name: contact-tracing-api-serverless
blockPublicAccess: true
serverSideEncryption: AES256
environment:
FIREBASE_DATABASE_URL: ${ssm:/envvars/${self:provider.stage}/FIREBASE_DATABASE_URL~true}
FIREBASE_STORAGE_BUCKET: ${ssm:/envvars/${self:provider.stage}/FIREBASE_STORAGE_BUCKET~true}
FIREBASE_type: ${ssm:/envvars/${self:provider.stage}/FIREBASE_type~true}
FIREBASE_project_id: ${ssm:/envvars/${self:provider.stage}/FIREBASE_project_id~true}
FIREBASE_private_key_id: ${ssm:/envvars/${self:provider.stage}/FIREBASE_private_key_id~true}
FIREBASE_private_key: ${ssm:/envvars/${self:provider.stage}/FIREBASE_private_key~true}
FIREBASE_client_email: ${ssm:/envvars/${self:provider.stage}/FIREBASE_client_email~true}
FIREBASE_client_id: ${ssm:/envvars/${self:provider.stage}/FIREBASE_client_id~true}
FIREBASE_auth_uri: ${ssm:/envvars/${self:provider.stage}/FIREBASE_auth_uri~true}
FIREBASE_token_uri: ${ssm:/envvars/${self:provider.stage}/FIREBASE_token_uri~true}
FIREBASE_auth_provider_x509_cert_url: ${ssm:/envvars/${self:provider.stage}/FIREBASE_auth_provider_x509_cert_url~true}
FIREBASE_client_x509_cert_url: ${ssm:/envvars/${self:provider.stage}/FIREBASE_client_x509_cert_url~true}
FIREBASE_WEB_API_KEY: ${ssm:/envvars/${self:provider.stage}/FIREBASE_WEB_API_KEY~true}
logs:
restApi: true
package:
include:
- dist/**
exclude:
- '**'
functions:
lambda-main:
handler: dist/lambda-main.handler
# provisionedConcurrency: 1
events:
- http:
path: /
method: any
cors: true
- http:
path: /{proxy+}
method: any
cors: true
lambda-swagger:
handler: dist/lambda-swagger.handler
events:
- http:
path: /swagger
method: any
cors: true
- http:
path: /swagger/{proxy+}
method: any
cors: true
lambda-schedule:
handler: dist/lambda-schedule.handler
reservedConcurrency: 1
events:
- schedule:
rate: rate(10 minutes)
plugins:
- serverless-deployment-bucket
- serverless-domain-manager
- serverless-layers
- serverless-offline
- serverless-prune-plugin
custom:
customDomain:
domainName: ${self:custom.SUBDOMAIN.${self:provider.stage}}.${self:custom.DOMAIN}
prune:
automatic: true
includeLayers: true
number: 5
DOMAIN: ${ssm:/singleton/domain_name}
SUBDOMAIN:
dev: api-dev
stg: api-stg
demo: api-demo
LOG_RETENTION_IN_DAYS:
dev: '7'
stg: '7'
demo: '30'
resources:
extensions:
LambdaDashswaggerLogGroup:
Properties:
RetentionInDays: '1'