-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
73 lines (67 loc) · 1.7 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
service: egov-adapter-traffic-radars
frameworkVersion: ">=1.34.0" # Layers are supported from version 1.34
custom:
bucket: egov-adapter-traffic-radars
region: eu-west-1
pythonRequirements:
dockerizePip: non-linux
zip: true
slim: true
slimPatterns:
- "cv2/data/*.xml"
- "**/tests"
strip: false # workaround for this issue https://github.com/UnitedIncome/serverless-python-requirements/issues/318
layer:
name: ${self:service}-python-requirements
description: Python requirements lambda layer
compatibleRuntimes:
- python3.6
- python3.7
licenseInfo: AGPLv3
allowedAccounts:
- '*'
provider:
name: aws
runtime: python3.7
region: ${self:custom.region}
stage: dev
versionFunctions: false
iamRoleStatements:
- Effect: Allow
Action:
- s3:CreateBucket
Resource: "arn:aws:s3:::*"
- Effect: Allow
Action:
- s3:PutObject
- S3:GetObject
Resource: "arn:aws:s3:::${self:custom.bucket}/*"
tags:
maintainer: egov
environment:
BUCKET: ${self:custom.bucket}
REGION: ${self:custom.region}
functions:
scrape:
timeout: 150
memorySize: 3008
handler: handler.scheduled_scrape
layers:
- {Ref: PythonRequirementsLambdaLayer}
events:
- schedule:
name: egov-adapter-traffic-radars-scrape
description: egov-adapter-traffic-radars scrape scheduling
rate: rate(6 hours)
adapt:
timeout: 5
memorySize: 256
handler: handler.adapt
layers:
- {Ref: PythonRequirementsLambdaLayer}
events:
- http:
path: "{proxy+}"
method: get
plugins:
- serverless-python-requirements