-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
56 lines (50 loc) · 2 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
service: chuck-infra-newsletter
custom:
defaultPackage: ./.serverless
package:
individually: true
plugins:
- serverless-plugin-optimize
provider:
accountId: ${file(./.decrypted/${opt:stage}/aws.json):accountId}
name: aws
runtime: nodejs6.10
region: ${file(./.decrypted/${opt:stage}/aws.json):region}
deploymentBucket: io.chucknorris.api
stage: ${file(./.decrypted/${opt:stage}/aws.json):stage}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource:
"arn:aws:s3:::io.chucknorris.api/newsletter/*"
- Effect: "Allow"
Action:
- "ses:*"
Resource:
"*"
functions:
publisher:
environment:
BLACKLIST_BUCKET: ${file(./.decrypted/${opt:stage}/blacklist.json):bucket}
BLACKLIST_KEY: ${file(./.decrypted/${opt:stage}/blacklist.json):key}
CONFIG_SET_NAME: ${file(./.decrypted/${opt:stage}/config.json):configurationSetName}
DOMAIN_WHITELIST: ${file(./.decrypted/${opt:stage}/config.json):domainWhitelist}
EMAIL_PUBLISHER: ${file(./.decrypted/${opt:stage}/config.json):emailPublisher}
EMAIL_SUBJECT_PREFIX: ${file(./.decrypted/${opt:stage}/config.json):emailSubjectPrefix}
EMAIL_TEMPLATE: ${file(./.decrypted/${opt:stage}/config.json):templateName}
ENVIRONMENT: ${opt:stage}
MAILCHIMP_API_DC: ${file(./.decrypted/${opt:stage}/mailchimp.json):datacenter}
MAILCHIMP_API_KEY: ${file(./.decrypted/${opt:stage}/mailchimp.json):key}
MAILCHIMP_LIST_ID: ${file(./.decrypted/${opt:stage}/mailchimp.json):list}
MAILCHIMP_USER_ID: ${file(./.decrypted/${opt:stage}/mailchimp.json):userId}
MAILCHIMP_USERNAME: ${file(./.decrypted/${opt:stage}/mailchimp.json):username}
events:
- schedule:
enabled: true
rate: cron(0 8 * * ? *)
handler: src/publisher/index.main
engagement:
events:
- sns: arn:aws:sns:${self:provider.region}:${self:provider.accountId}:chuck-email-engagement-${self:provider.stage}
handler: src/engagement/index.main