-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
86 lines (78 loc) · 2.03 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
service: cornerwise-scrapers
custom:
default_stage: dev
docs_bucket: cornerwise-docs-${opt:stage, self:custom.default_stage}
bucket_arn: arn:aws:s3:::${self:custom.docs_bucket}
pythonRequirements:
dockerizePip: true
provider:
name: aws
runtime: python3.6
timeout: 120
profile: cornerwise
environment:
SOCRATA_TOKEN: ${file(./credentials.json):socrata_app_token}
SOCRATA_SECRET: ${file(./credentials.json):socrata_app_secret}
DOCS_BUCKET: ${self:custom.docs_bucket}
usagePlan:
quota:
limit: 1000
period: MONTH
iamRoleStatements:
- Effect: Allow
Action:
- s3:*
Resource: ${self:custom.bucket_arn}/*
functions:
somervillema:
handler: somervillema.scrape
description: "Scrapes the OSPCD's Reports and Decisions page for recent applications submitted for review to Somerville's Planning Board and Zoning Board of Appeals."
events:
- http:
path: somervillema
method: get
somervillema_projects:
handler: somervillema_projects.scrape
events:
- http:
path: somervillema_projects
method: get
somervillema_events:
handler: somervillema_events.run
description: "Scrapes the Somerville events page for documents related to the Planning Board and ZBA."
events:
- http:
path: somervillema_events
method: get
cambridgema:
handler: cambridgema.scrape
events:
- http:
path: cambridgema
method: get
greenline:
handler: greenline.handler
events:
- http:
path: greenline
method: get
extract_text:
handler: docs.extract_text
layers:
- {Ref: PdftoolsLambdaLayer}
events:
- s3:
bucket: ${self:custom.docs_bucket}
event: s3:ObjectCreated:*
rules:
- suffix: .pdf
download_docs:
handler: docs.download
events:
- schedule: cron(0 0 * * ? *)
plugins:
- serverless-python-requirements
layers:
pdftools:
package:
artifact: pdftools.zip