-
Notifications
You must be signed in to change notification settings - Fork 6
/
serverless.yaml
228 lines (219 loc) · 8.74 KB
/
serverless.yaml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
service: trackovid19-backend
frameworkVersion: ">=1.1.0 <2.0.0"
provider:
name: aws
runtime: nodejs12.x
region: eu-west-1
stage: ${opt:stage, 'dev'}
environment:
AWS_EXECUTION_ENV: ${opt:stage, 'dev'}
DB_HOST: ${self:custom.DB_HOST.${opt:stage, 'dev'}}
DB_USER: ${self:custom.DB_USER.${opt:stage, 'dev'}}
DB_PASS: ${self:custom.DB_PASS.${opt:stage, 'dev'}}
DB_NAME: ${self:custom.DB_NAME.${opt:stage, 'dev'}}
DB_PORT: ${self:custom.DB_PORT.${opt:stage, 'dev'}}
CORS_ORIGIN: ${self:custom.CORS_ORIGIN.${opt:stage, 'dev'}}
FB_APP_ID: ${self:custom.FB_APP_ID.${opt:stage, 'dev'}}
FB_APP_SECRET: ${self:custom.FB_APP_SECRET.${opt:stage, 'dev'}}
FB_APP_SCOPE: ${self:custom.FB_APP_SCOPE.${opt:stage, 'dev'}}
FB_CALLBACK_URL: ${self:custom.FB_CALLBACK_URL.${opt:stage, 'dev'}}
FB_USER_INFO_URL: ${self:custom.FB_USER_INFO_URL.${opt:stage, 'dev'}}
GOOGLE_APP_ID: ${self:custom.GOOGLE_APP_ID.${opt:stage, 'dev'}}
GOOGLE_APP_SECRET: ${self:custom.GOOGLE_APP_SECRET.${opt:stage, 'dev'}}
GOOGLE_APP_SCOPE: ${self:custom.GOOGLE_APP_SCOPE.${opt:stage, 'dev'}}
GOOGLE_CALLBACK_URL: ${self:custom.GOOGLE_CALLBACK_URL.${opt:stage, 'dev'}}
GOOGLE_USER_INFO_URL: ${self:custom.GOOGLE_USER_INFO_URL.${opt:stage, 'dev'}}
AFTER_LOGIN_CALLBACK_URL: ${self:custom.AFTER_LOGIN_CALLBACK_URL.${opt:stage, 'dev'}}
JWT_SECRET: ${self:custom.JWT_SECRET.${opt:stage, 'dev'}}
HOME_URL: ${self:custom.HOME_URL.${opt:stage, 'dev'}}
GCM_API_KEY: ${self:custom.GCM_API_KEY.${opt:stage, 'dev'}}
VAPID_PRIVATE_KEY: ${self:custom.VAPID_PRIVATE_KEY.${opt:stage, 'dev'}}
VAPID_PUBLIC_KEY: ${self:custom.VAPID_PUBLIC_KEY.${opt:stage, 'dev'}}
VAPID_SUBJECT: ${self:custom.VAPID_SUBJECT.${opt:stage, 'dev'}}
AES_256_KEY: ${self:custom.AES_256_KEY.${opt:stage, 'dev'}}
PRODUCTION: ${self:custom.PRODUCTION.${opt:stage, 'dev'}}
AWS_REGION_SNS: ${self:custom.AWS_REGION_SNS.${opt:stage, 'dev'}}
AWS_SNS_ACCESS_KEY_ID: ${self:custom.AWS_SNS_ACCESS_KEY_ID.${opt:stage, 'dev'}}
AWS_SNS_SECRET_ACCESS_KEY: ${self:custom.AWS_SNS_SECRET_ACCESS_KEY.${opt:stage, 'dev'}}
AWS_SNS_TOPICARN: ${self:custom.AWS_SNS_TOPICARN.${opt:stage, 'dev'}}
AWS_REGION_S3: ${self:custom.AWS_REGION_S3.${opt:stage, 'dev'}}
AWS_S3_ACCESS_KEY_ID: ${self:custom.AWS_S3_ACCESS_KEY_ID.${opt:stage, 'dev'}}
AWS_S3_SECRET_ACCESS_KEY: ${self:custom.AWS_S3_SECRET_ACCESS_KEY.${opt:stage, 'dev'}}
AWS_S3_BUCKET: ${self:custom.AWS_S3_BUCKET.${opt:stage, 'dev'}}
AWS_S3_DOMAIN: ${self:custom.AWS_S3_DOMAIN.${opt:stage, 'dev'}}
AWS_SNS_FAIL_EMAIL_TOPICARN: ${self:custom.AWS_SNS_FAIL_EMAIL_TOPICARN.${opt:stage, 'dev'}}
FONTCONFIG_PATH: ${self:custom.FONTCONFIG_PATH.${opt:stage, 'dev'}}
PANGOCAIRO_BACKEND: ${self:custom.PANGOCAIRO_BACKEND.${opt:stage, 'dev'}}
functions:
app:
handler: app.handler
layers:
- arn:aws:lambda:eu-west-1:788648735177:layer:canvas-lib64-layer:1
events:
- http:
path: /
method: ANY
- http:
path: /{proxy+}
method: ANY
notifications:
handler: jobs/notify-users-no-update-24h.handler
events:
- schedule: rate(10 minutes)
# Custom Variables
custom:
stages:
- dev
- staging
- prd
FB_APP_ID:
dev: 142877133789647
staging: 139971950784932
prd: 246657783167062
FB_APP_SECRET:
dev: ${opt:fb_secret, 'FB_SECRET_DEV'}
staging: ${opt:fb_secret, 'FB_SECRET_STAGING'}
prd: ${opt:fb_secret, 'FB_SECRET_PROD'}
FB_CALLBACK_URL:
dev: https://dev.api.covidografia.pt/api/v1
staging: https://staging.api.covidografia.pt/api/v1
prd: https://api.covidografia.pt/api/v1
FB_APP_SCOPE:
dev: email,public_profile
staging: email,public_profile
prd: email,public_profile
FB_USER_INFO_URL:
dev: https://graph.facebook.com/v3.0/me?fields=id,name,email
staging: https://graph.facebook.com/v3.0/me?fields=id,name,email
prd: https://graph.facebook.com/v3.0/me?fields=id,name,email
GOOGLE_APP_ID:
dev: 229617499859-jhpv1jbtq3fdnntsa7m8c9s9ug4v4mh2.apps.googleusercontent.com
staging: 521794831407-kgvjkksomko9rg6um8i7s076l0a9ltjh.apps.googleusercontent.com
prd: 921023977289-prbb3f1mseoni2sscgurodbmsqm2p87e.apps.googleusercontent.com
GOOGLE_APP_SECRET:
dev: ${opt:google_secret, 'GOOGLE_SECRET_DEV'}
staging: ${opt:google_secret, 'GOOGLE_SECRET_STAGING'}
prd: ${opt:google_secret, 'GOOGLE_SECRET_PROD'}
GOOGLE_APP_SCOPE:
dev: profile email openid
staging: profile email openid
prd: profile email openid
GOOGLE_CALLBACK_URL:
dev: https://dev.api.covidografia.pt/api/v1
staging: https://staging.api.covidografia.pt/api/v1
prd: https://api.covidografia.pt/api/v1
GOOGLE_USER_INFO_URL:
dev: https://www.googleapis.com/oauth2/v1/userinfo
staging: https://www.googleapis.com/oauth2/v1/userinfo
prd: https://www.googleapis.com/oauth2/v1/userinfo
AFTER_LOGIN_CALLBACK_URL:
dev: http://localhost:4200
staging: https://staging.app.covidografia.pt
prd: https://app.covidografia.pt
DB_HOST:
dev: staging.db.covidografia.pt
staging: staging.db.covidografia.pt
prd: db.covidografia.pt
DB_NAME:
dev: postgres
staging: postgres
prd: postgres
DB_USER:
dev: postgres
staging: postgres
prd: postgres
DB_PASS:
dev: ${opt:db_pass, 'PASSWORD_DEV'}
staging: ${opt:db_pass, 'PASSWORD_STAGING'}
prd: ${opt:db_pass, 'PASSWORD_PRD'}
DB_PORT:
dev: "54320"
staging: "54320"
prd: "54320"
JWT_SECRET:
dev: ${opt:jwt_secret, 'JWT_SECRET_DEV'}
staging: ${opt:jwt_secret, 'JWT_SECRET_STAGING'}
prd: ${opt:jwt_secret, 'JWT_SECRET_PROD'}
HOME_URL:
dev: http://localhost:4200
staging: https://www.covidografia.pt
prd: https://www.covidografia.pt
GCM_API_KEY:
dev: ${opt:gcm_api_key, 'GCM_API_KEY_DEV'}
staging: ${opt:gcm_api_key, 'GCM_API_KEY_STAGING'}
prd: ${opt:gcm_api_key, 'GCM_API_KEY_PROD'}
VAPID_PUBLIC_KEY:
dev: BA5Tr13lfJCBPb9ZaXlTKUetDORnHROGI_S7cumwdDR9f-ZxYI-4Y2OvIC4WgZxcanE9znpKufP6wLA5kdIG2Ak
staging: BA5Tr13lfJCBPb9ZaXlTKUetDORnHROGI_S7cumwdDR9f-ZxYI-4Y2OvIC4WgZxcanE9znpKufP6wLA5kdIG2Ak
prd: BBEe8XE4MAZu390e-VzBCzjK_QyY4Zra0R6kY-wARxKxWbHOM-KgxSURL6FOzftYG9ht1UvMvONBzpKRxWaIJhU
VAPID_PRIVATE_KEY:
dev: ${opt:vapid_priv_key, 'VAPID_PRIVATE_KEY_DEV'}
staging: ${opt:vapid_priv_key, 'VAPID_PRIVATE_KEY_STAGING'}
prd: ${opt:vapid_priv_key, 'VAPID_PRIVATE_KEY_PROD'}
VAPID_SUBJECT:
dev: http://localhost:4200
staging: https://staging.app.covidografia.pt
prd: https://app.covidografia.pt
AES_256_KEY:
dev: ${opt:aes_key, 'AES_256_KEY_DEV'}
staging: ${opt:aes_key, 'AES_256_KEY_STAGING'}
prd: ${opt:aes_key, 'AES_256_KEY_PROD'}
PRODUCTION:
dev: 0
staging: 0
prd: 1
AWS_SNS_ACCESS_KEY_ID:
dev: AKIA3PHZAWHE536M366R
staging: AKIA3PHZAWHE536M366R
prd: AKIA3PHZAWHE536M366R
AWS_SNS_SECRET_ACCESS_KEY:
dev: ${opt:aws_sns_secret, 'AWS_SNS_SECRET_ACCESS_KEY_DEV'}
staging: ${opt:aws_sns_secret, 'AWS_SNS_SECRET_ACCESS_KEY_STAGING'}
prd: ${opt:aws_sns_secret, 'AWS_SNS_SECRET_ACCESS_KEY_PROD'}
AWS_SNS_TOPICARN:
dev: arn:aws:sns:eu-west-1:788648735177:user-data-removal-audit-staging
staging: arn:aws:sns:eu-west-1:788648735177:user-data-removal-audit-staging
prd: arn:aws:sns:eu-west-1:788648735177:user-data-removal-audit
AWS_REGION_SNS:
dev: eu-west-1
staging: eu-west-1
prd: eu-west-1
AWS_REGION_S3:
dev: eu-west-1
staging: eu-west-1
prd: eu-west-1
AWS_S3_ACCESS_KEY_ID:
dev: AKIA3PHZAWHE454DOOR2
staging: AKIA3PHZAWHE454DOOR2
prd: AKIA3PHZAWHE454DOOR2
AWS_S3_SECRET_ACCESS_KEY:
dev: ${opt:aws_s3_secret, 'AWS_S3_SECRET_ACCESS_KEY_DEV'}
staging: ${opt:aws_s3_secret, 'AWS_S3_SECRET_ACCESS_KEY_STAGING'}
prd: ${opt:aws_s3_secret, 'AWS_S3_SECRET_ACCESS_KEY_PROD'}
AWS_S3_BUCKET:
dev: covidografia-share-dashboard
staging: covidografia-share-dashboard
prd: covidografia-share-dashboard-production
AWS_S3_DOMAIN:
dev: https://staging.static.covidografia.pt
staging: https://staging.static.covidografia.pt
prd: https://static.covidografia.pt
CORS_ORIGIN:
dev: http://localhost
staging: https://staging.app.covidografia.pt
prd: https://app.covidografia.pt
AWS_SNS_FAIL_EMAIL_TOPICARN:
dev: arn:aws:sns:eu-west-1:788648735177:user-data-removal-notification-error-staging
staging: arn:aws:sns:eu-west-1:788648735177:user-data-removal-notification-error-staging
prd: arn:aws:sns:eu-west-1:788648735177:user-data-removal-notification-error
FONTCONFIG_PATH:
dev: /var/task/fonts
staging: /var/task/fonts
prd: /var/task/fonts
PANGOCAIRO_BACKEND:
dev: fontconfig
staging: fontconfig
prd: fontconfig
# Plugins
plugins:
- serverless-stage-manager