-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
112 lines (103 loc) · 2.4 KB
/
Copy pathserverless.yml
File metadata and controls
112 lines (103 loc) · 2.4 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
service: admin-service
provider:
name: aws
runtime: python3.7
stage: ${env:GDL_ENVIRONMENT}
region: eu-central-1
endpointType: PRIVATE
role: arn:aws:iam::${env:GDL_ACCOUNT}:role/${env:SERVERLESS_IAM_ROLE}
tags:
VERSION: "0.3"
deploymentBucket:
name: ${env:GDL_SERVERLESS_DEPLOYMENT_BUCKET}
resourcePolicy:
- Effect: Allow
Principal: "*"
Action: execute-api:Invoke
Resource:
- execute-api:/*/*/*
Condition:
StringEquals:
aws:SourceVpce:
- '${env:VPC_ENDPOINT}'
package:
individually: true
exclude:
- ./**
functions:
slacknotifier:
handler: handler.main
module: functions/slacknotifier
events:
- sns:
arn: ${env:GDL_SURVEILLANCE_SNS_ARN}
environment:
SLACK_WEBHOOK_URL: ${env:SLACK_WEBHOOK_URL}
package:
include:
- functions/slacknotifier/*.py
- functions/slacknotifier/gdl/*.py
exclude:
- "**tests/**"
mostread:
handler: handler.main
module: functions/mostread
events:
- http:
path: most-read
method: get
request:
parameters:
querystrings:
days: false
n: false
environment:
ANALYTICS_CREDENTIALS: ${env:ANALYTICS_CREDENTIALS}
ANALYTICS_VIEW_ID: ${env:ANALYTICS_VIEW_ID}
package:
include:
- functions/mostread/*.py
- functions/mostread/gdl/*.py
exclude:
- "**tests/**"
spellcheck:
handler: handler.main
module: functions/spellcheck
timeout: 120
events:
- http:
path: spellcheck
method: post
- http:
path: spellcheck
method: get
request:
parameters:
querystrings:
text: true
environment:
BING_API_KEY: ${env:BING_API_KEY}
package:
include:
- functions/spellcheck/*.py
- functions/spellcheck/gdl/*.py
exclude:
- "**tests/**"
plugins:
- serverless-vpc-discovery
- serverless-python-requirements
- serverless-plugin-warmup
custom:
vpc:
vpcName: ${env:VPC}
subnetNames:
- '${env:GDL_ENVIRONMENT}.private_a.gdl'
- '${env:GDL_ENVIRONMENT}.private_b.gdl'
securityGroupNames:
- 'serverless-security_group'
pythonRequirements:
dockerizePip: non-linux
slim: true
warmup:
enabled:
- prod