-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
87 lines (81 loc) · 2.02 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
# This file is the main config file for your service.
# For full config options, check the docs:
# docs.serverless.com
service: GazetteMachine
plugins:
- serverless-python-requirements
provider:
name: aws
runtime: python3.8
region: eu-west-1
profile: lawsafrica
stage: production
timeout: 30
environment:
API_AUTH_TOKEN: ${ssm:GazetteMachine-API-auth-token}
MIRROR_TARGETS: ${ssm:GazetteMachine-mirror-targets}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:PutBucketNotification"
Resource:
- "arn:aws:s3:::lawsafrica-gazettes-incoming"
- "arn:aws:s3:::lawsafrica-gazettes-archive"
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:DeleteObject"
- "s3:PutObject"
Resource:
- "arn:aws:s3:::lawsafrica-gazettes-incoming"
- "arn:aws:s3:::lawsafrica-gazettes-incoming/*"
- Effect: "Allow"
Action:
- "s3:GetObject"
Resource:
- "arn:aws:s3:::lawsafrica-gazettes-archive"
- "arn:aws:s3:::lawsafrica-gazettes-archive/*"
tracing:
lambda: true
package:
exclude:
- "./**"
include:
- service.py
custom:
pythonRequirements:
slim: true
functions:
IncomingFromS3:
handler: service.incoming_from_s3
events:
- s3:
bucket: lawsafrica-gazettes-incoming
existing: true
event: s3:ObjectCreated:*
rules:
- prefix: dropbox/
EmailFromS3:
handler: service.email_from_s3
events:
- s3:
bucket: lawsafrica-gazettes-incoming
existing: true
event: s3:ObjectCreated:*
rules:
- prefix: email/
ArchivedGazetteChanged:
handler: service.archived_gazette_changed
events:
- s3:
bucket: lawsafrica-gazettes-archive
event: s3:ObjectCreated:*
rules:
- prefix: archive/
existing: true
- s3:
bucket: lawsafrica-gazettes-archive
event: s3:ObjectRemoved:*
rules:
- prefix: archive/
existing: true