-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
140 lines (119 loc) · 2.49 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
app: voting-app-api
service: voting-app-api
frameworkVersion: ">=1.1.0 <=2.0.0"
plugins:
- serverless-python-requirements
- serverless-offline
provider:
name: aws
stage: dev
region: ap-southeast-2
runtime: python3.8
environment:
MONGO_DB_USER: ${env:MONGO_DB_USER}
MONGO_DB_PASS: ${env:MONGO_DB_PASS}
MONGO_DB_NAME: votingdb
MONGO_DB_URL: ${env:MONGO_DB_URL}
ISSUE_CREATE_TOKEN: ${env:ISSUE_CREATE_TOKEN}
PRIVATE_KEY: ${env:PRIVATE_KEY}
iamManagedPolicies:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
package:
individually: true
exclude:
- node_modules/**
- venv/**
functions:
getbill:
handler: bill/get.get
events:
- http:
path: bill/{id}
method: get
cors: true
listbill:
handler: bill/list.list
events:
- http:
path: bill
method: get
cors: true
getissue:
handler: issue/get.get
events:
- http:
path: issue/{id}
method: get
cors: true
listissue:
handler: issue/list.list
events:
- http:
path: issue
method: get
cors: true
makeissue:
handler: issue/create.create
events:
- http:
path: issue
method: post
cors: true
getspec:
handler: spec/get.get
events:
- http:
path: spec/{id}
method: get
cors: true
listspec:
handler: spec/list.list
events:
- http:
path: spec
method: get
cors: true
getballot:
handler: shitchain/get.get
events:
- http:
path: shitchain/{id}
method: get
cors: true
listballot:
handler: shitchain/list.list
events:
- http:
path: shitchain
method: get
cors: true
makevote:
handler: shitchain/create.create
events:
- http:
path: shitchain
method: post
cors: true
getresult:
handler: result/get.get
events:
- http:
path: result/{id}
method: get
cors: true
listresult:
handler: result/list.list
events:
- http:
path: result
method: get
cors: true
# updatebills:
# handler: update_bills_db.run
# events:
# - schedule: rate(24 hours)
# - schedule: cron(0 5 * * ? *)
updateresults:
handler: update_results_db.run
events:
- schedule: rate(5 minutes)