-
Notifications
You must be signed in to change notification settings - Fork 30
/
serverless.yml.template
66 lines (58 loc) · 1.59 KB
/
serverless.yml.template
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
service: ttc-subway-times
provider:
name: aws
runtime: python3.7
timeout: 300
stage: ${opt:stage, 'dev'}
iamRoleStatements:
- Effect: Allow
Action:
- s3:PutObject
- s3:GetObject
Resource: "arn:aws:s3:::${self:custom.bucket.${self:provider.stage}}/*"
- Effect: Allow
Action:
- s3:ListBucket
Resource: "arn:aws:s3:::${self:custom.bucket.${self:provider.stage}}"
package:
exclude:
- "**"
include: # Specify the directories and files which should be included in the deployment package
- src/ttc_api_scraper/writers.py
- src/ttc_api_scraper/ttc_api_scraper.py
- src/ttc_api_scraper/consolidate.py
- db.cfg
functions:
ttc_api_scrape:
name: ${self:provider.stage}-ttc_api-scrape
handler: src/ttc_api_scraper/ttc_api_scraper.handler
events:
- schedule:
rate: cron(* 0-2,5-23 * * ? *)
timezone: America/Toronto
environment:
S3_BUCKET: ${self:custom.bucket.${self:provider.stage}}
LOG_LEVEL: INFO
PYTHONPATH: src/
consolidate:
name: ${self:provider.stage}-consolidate
handler: src/ttc_api_scraper/consolidate.handler
events:
- schedule:
rate: cron(20 4 * * ? *)
timezone: America/Toronto
environment:
S3_BUCKET: ${self:custom.bucket.${self:provider.stage}}
LOG_LEVEL: INFO
PYTHONPATH: src/
plugins:
- serverless-python-requirements
- serverless-local-schedule
custom:
pythonRequirements:
dockerizePip: true
suffix-dev: .dev
suffix-prod:
bucket:
dev: <AWS DEV S3 BUCKET>
prod: <AWS PROD S3 BUCKET>