-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathenv.yml
299 lines (297 loc) · 12.2 KB
/
env.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
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
dev: &devConfig
environmentSecrets: &environmentSecrets
FLICKR_API_KEY: flickr-api-key
FLICKR_API_SECRET: flickr-api-secret
UNSPLASH_API_KEY: unsplash-api-key
UNSPLASH_API_SECRET: unsplash-api-secret
FACEBOOK_API_KEY: facebook-api-key
FACEBOOK_API_SECRET: facebook-api-secret
FACEBOOK_ACCESS_TOKEN: facebook-access-token
INSTAGRAM_API_KEY: instagram-api-key
INSTAGRAM_API_SECRET: instagram-api-secret
INSTAGRAM_ACCESS_TOKEN: instagram-access-token
TUMBLR_API_KEY: tumblr-api-key
TUMBLR_API_SECRET: tumblr-api-secret
LINKEDIN_API_KEY: linkedin-api-key
LINKEDIN_API_SECRET: linkedin-api-secret
GITHUB_API_KEY: github-api-key
GITHUB_API_SECRET: github-api-secret
TWITTER_API_KEY: twitter-api-key
TWITTER_API_SECRET: twitter-api-secret
TWITTER_API_ACCESS_TOKEN: twitter-api-key
TWITTER_API_ACCESS_TOKEN_SECRET: twitter-api-secret
SENTRY_DSN: sentry-dsn
baseDomainName: ${self:provider.stage}.randytarampi.ca
domainName: ${self:service}.${self:provider.baseDomainName}
acmArn: arn:aws:acm:us-east-1:471964952458:certificate/ddc5763c-2f1e-48de-9bc7-aae1085cf915
acmName: "*.dev.randytarampi.ca"
kmsKeyArn: arn:aws:kms:us-east-1:471964952458:key/a83b4a56-95a6-4b38-8981-c32c67e3e8f3
alarmTopic: arn:aws:sns:us-east-1:471964952458:CloudWatchNotifications
environment: &environment
CAMPAIGN_SOURCE: ${file(package.json):name}
CAMPAIGN_CONTENT: ${file(package.json):version}
ME_PERSON_NAME: ${file(src/serverless/util/loadConfig.js):default.me.person.name}
ME_PERSON_JOB_TITLE: ${file(src/serverless/util/loadConfig.js):default.me.person.jobTitle}
ME_PERSON_IMAGE: ${file(src/serverless/util/loadConfig.js):default.me.person.image}
ME_PERSON_DESCRIPTION: ${file(src/serverless/util/loadConfig.js):default.me.person.description}
ME_PERSON_EMAIL: ${file(src/serverless/util/loadConfig.js):default.me.person.email}
SERVICE_POSTS_DYNAMODB_TABLE: ${self:provider.stage}-${self:service}-posts-2019-01-11
SERVICE_AUTH_INFO_DYNAMODB_TABLE: ${self:provider.stage}-${self:service}-authInfo-2019-01-18
FLICKR_USER_NAME: ${file(src/serverless/util/loadConfig.js):default.me.profiles.Flickr.username}
UNSPLASH_USER_NAME: ${file(src/serverless/util/loadConfig.js):default.me.profiles.Unsplash.username}
FACEBOOK_AUTH_CALLBACK_URI: https://${self:provider.domainName}/auth/facebook/callback
FACEBOOK_AUTH_DEAUTH_CALLBACK_URI: https://${self:provider.domainName}/auth/facebook/revoke/callback
FACEBOOK_DATA_DELETE_CALLBACK_URI: https://${self:provider.domainName}/delete/facebook/callback
INSTAGRAM_AUTH_CALLBACK_URI: https://${self:provider.domainName}/auth/instagram/callback
TWITTER_AUTH_CALLBACK_URI: https://${self:provider.domainName}/auth/twitter/callback
TUMBLR_USER_NAME: ${file(src/serverless/util/loadConfig.js):default.me.profiles.Tumblr.username}
SERVICE_POSTS_S3_BUCKET_NAME: randytarampi-${self:service}-${self:provider.stage}-posts
FEED_URL: ${file(src/serverless/util/loadConfig.js):default.posts.feedUrl}
BLOG_URL: ${file(src/serverless/util/loadConfig.js):default.www.publishUrl}${file(src/serverless/util/loadConfig.js):default.www.postsUrl}
PHOTOS_URL: ${file(src/serverless/util/loadConfig.js):default.www.publishUrl}${file(src/serverless/util/loadConfig.js):default.www.photosUrl}
WORDS_URL: ${file(src/serverless/util/loadConfig.js):default.www.publishUrl}${file(src/serverless/util/loadConfig.js):default.www.wordsUrl}
WWW_URL: ${file(src/serverless/util/loadConfig.js):default.www.publishUrl}
SERVERLESS_STAGE: ${self:provider.stage}
SERVERLESS_SERVICE: ${self:service}
LOGGER_ENABLED: ${file(src/serverless/util/loadConfig.js):default.logger.enabled}
LOGGER_LEVEL: ${file(src/serverless/util/loadConfig.js):default.logger.level}
LOGGER_SRC_ENABLED: ${file(src/serverless/util/loadConfig.js):default.logger.src}
LOGGER_STREAM_HUMAN_ENABLED: ${file(src/serverless/util/loadConfig.js):default.logger.streams.human}
LOGGER_STREAM_STDOUT_ENABLED: ${file(src/serverless/util/loadConfig.js):default.logger.streams.stdout}
LOGGER_STREAM_SENTRY_ENABLED: ${file(src/serverless/util/loadConfig.js):default.logger.streams.sentry}
functions: &functions
cachePosts: &cachePosts
events:
- schedule:
rate: cron(1 0/1 * * ? *)
input:
postsSearchParameters:
orderBy: datePublished
orderOperator: ge
relativeOrderComparatorAdjustment: P1W
relativeOrderComparatorAdjustmentOperator: DateTime.minus
relativeOrderComparatorAdjustmentType: Duration
relativeOrderComparatorBasis: now
relativeOrderComparatorBasisType: DateTime
sources:
- flickr
- schedule:
rate: cron(5 0/1 * * ? *)
input:
postsSearchParameters:
orderBy: datePublished
orderOperator: ge
relativeOrderComparatorAdjustment: P1W
relativeOrderComparatorAdjustmentOperator: DateTime.minus
relativeOrderComparatorAdjustmentType: Duration
relativeOrderComparatorBasis: now
relativeOrderComparatorBasisType: DateTime
sources:
- unsplash
- schedule:
rate: cron(7 0/1 * * ? *)
input:
postsSearchParameters:
orderBy: datePublished
orderOperator: ge
relativeOrderComparatorAdjustment: P1W
relativeOrderComparatorAdjustmentOperator: DateTime.minus
relativeOrderComparatorAdjustmentType: Duration
relativeOrderComparatorBasis: now
relativeOrderComparatorBasisType: DateTime
sources:
- instagram
- schedule:
rate: cron(8 0/1 * * ? *)
input:
postsSearchParameters:
orderBy: datePublished
orderOperator: ge
relativeOrderComparatorAdjustment: P1W
relativeOrderComparatorAdjustmentOperator: DateTime.minus
relativeOrderComparatorAdjustmentType: Duration
relativeOrderComparatorBasis: now
relativeOrderComparatorBasisType: DateTime
sources:
- s3
- schedule:
rate: cron(9 0/1 * * ? *)
input:
postsSearchParameters:
orderBy: datePublished
orderOperator: ge
relativeOrderComparatorAdjustment: P1W
relativeOrderComparatorAdjustmentOperator: DateTime.minus
relativeOrderComparatorAdjustmentType: Duration
relativeOrderComparatorBasis: now
relativeOrderComparatorBasisType: DateTime
sources:
- tumblr
- schedule:
rate: cron(11 0/1 * * ? *)
input:
postsSearchParameters:
orderBy: datePublished
orderOperator: ge
relativeOrderComparatorAdjustment: P1W
relativeOrderComparatorAdjustmentOperator: DateTime.minus
relativeOrderComparatorAdjustmentType: Duration
relativeOrderComparatorBasis: now
relativeOrderComparatorBasisType: DateTime
sources:
- twitter
- schedule:
rate: cron(13 0/1 * * ? *)
input:
postsSearchParameters:
orderBy: datePublished
orderOperator: ge
relativeOrderComparatorAdjustment: P1W
relativeOrderComparatorAdjustmentOperator: DateTime.minus
relativeOrderComparatorAdjustmentType: Duration
relativeOrderComparatorBasis: now
relativeOrderComparatorBasisType: DateTime
sources:
- facebook
getPosts:
events:
- http:
path: posts
method: get
cors: &corsConfiguration
origin: "*"
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
- ME-API-VERSION # NOTE-RT: It'd be really nice to just read this from a JS file, but then we'd need to babel everything before building the configuration, which is gross.
getPostsRss:
environment:
CAMPAIGN_MEDIUM: rss
events:
- http:
path: posts/feed.rss
method: get
cors: *corsConfiguration
facebookAuthRedirect: &facebookAuthRedirect
events:
- http:
path: auth/facebook
method: get
cors: *corsConfiguration
private: true
facebookAuthCallback: &facebookAuthCallback
events:
- http:
path: auth/facebook/callback
method: get
cors: *corsConfiguration
instagramAuthRedirect: &instagramAuthRedirect
events:
- http:
path: auth/instagram
method: get
cors: *corsConfiguration
private: true
instagramAuthCallback: &instagramAuthCallback
events:
- http:
path: auth/instagram/callback
method: get
cors: *corsConfiguration
twitterAuthRedirect: &twitterAuthRedirect
events:
- http:
path: auth/twitter
method: get
cors: *corsConfiguration
private: true
twitterAuthCallback: &twitterAuthCallback
events:
- http:
path: auth/twitter/callback
method: get
cors: *corsConfiguration
prd:
<<: *devConfig
environment:
<<: *environment
baseDomainName: randytarampi.ca
domainName: ${self:service}.${self:provider.baseDomainName}
acmArn: arn:aws:acm:us-east-1:471964952458:certificate/b363d5a1-7db1-4504-94a1-1dbe9273ae62
acmName: "*.randytarampi.ca"
kmsKeyArn: arn:aws:kms:ca-central-1:471964952458:key/680708d1-fd35-4b54-af45-7adaba70f451
alarmTopic: arn:aws:sns:ca-central-1:471964952458:CloudWatchNotifications
local:
<<: *devConfig
environment:
<<: *environment
SERVICE_POSTS_DYNAMODB_TABLE: local-posts
SERVICE_AUTH_INFO_DYNAMODB_TABLE: local-authInfo
AWS_XRAY_CONTEXT_MISSING: LOG_ERROR
FACEBOOK_AUTH_CALLBACK_URI: http://localhost:3006/auth/facebook/callback
INSTAGRAM_AUTH_CALLBACK_URI: https://localhost:3006/auth/instagram/callback
TWITTER_AUTH_CALLBACK_URI: http://localhost:3006/auth/twitter/callback
PHOTOS_URL: http://localhost:3006/photos
WORDS_URL: http://localhost:3006/words
AWS_REGION: us-east-1
functions:
<<: *functions
cachePosts:
<<: *cachePosts
events:
- http:
path: cache/posts
method: get
cors: *corsConfiguration
facebookAuthRedirect:
<<: *facebookAuthRedirect
events:
- http:
path: auth/facebook
method: get
cors: *corsConfiguration
private: false
facebookAuthCallback:
<<: *facebookAuthCallback
events:
- http:
path: auth/facebook/callback
method: get
cors: *corsConfiguration
private: false
instagramAuthRedirect:
<<: *instagramAuthRedirect
events:
- http:
path: auth/instagram
method: get
cors: *corsConfiguration
private: false
instagramAuthCallback:
<<: *instagramAuthCallback
events:
- http:
path: auth/instagram/callback
method: get
cors: *corsConfiguration
private: false
twitterAuthRedirect:
<<: *twitterAuthRedirect
events:
- http:
path: auth/twitter
method: get
cors: *corsConfiguration
private: false
twitterAuthCallback:
<<: *twitterAuthCallback
events:
- http:
path: auth/twitter/callback
method: get
cors: *corsConfiguration
private: false