-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathserverless.yml
166 lines (143 loc) · 3.51 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
service: cowin-notification-service
app: cowin-notification-service
org: reziba
frameworkVersion: '2'
custom:
secrets: ${file(secrets.${opt:stage, self:provider.stage}.yml)}
provider:
name: aws
runtime: python3.8
timeout: 5
memorySize: 128
lambdaHashingVersion: 20201221
stage: dev
region: ap-south-1
iam:
role:
statements:
- Effect: Allow
Action:
- s3:*
- cloudwatch:*
- sqs:*
- ses:*
- lambda:*
Resource: '*'
environment:
DB_HOSTNAME: ${self:custom.secrets.DB_HOSTNAME}
DB_PASSWORD: ${self:custom.secrets.DB_PASSWORD}
DB_PORT: ${self:custom.secrets.DB_PORT}
DB_USER: ${self:custom.secrets.DB_USER}
DB_NAME: ${self:custom.secrets.DB_NAME}
COWIN_URL: ${self:custom.secrets.COWIN_URL}
GCP_API_KEY: ${self:custom.secrets.GCP_API_KEY}
# NOTIF_QUEUE_URL: !Ref NotificationQueue
SENDER_EMAIL: ${self:custom.secrets.SENDER_EMAIL}
WEBSITE_URL: ${self:custom.secrets.WEBSITE_URL}
DUMMY: 'abc'
apiGateway:
shouldStartNameWithService: true
plugins:
- serverless-python-requirements
- serverless-secrets-plugin
package:
individually: true
exclude:
- venv/**
- node_modules/**
- frontend/**
- scripts/**
functions:
get_states:
handler: handler.get_states
events:
- http:
path: /states
method: get
get_districts:
handler: handler.get_districts
events:
- http:
path: /districts
method: get
check_district_nums:
handler: handler.check_district_nums
get_centers:
handler: handler.get_centers
events:
- http:
path: /centers
method: get
get_district_preferences:
handler: handler.get_district_preferences
events:
- http:
path: /centers/preferences
method: get
subscribe:
handler: handler.subscribe
events:
- http:
path: /subscribe
method: post
cors: true
unsubscribe:
handler: handler.unsubscribe
events:
- http:
path: /unsubscribe
method: post
cors: true
trigger_district_updates:
handler: handler.trigger_district_updates
timeout: 30
maximumRetryAttempts: 0
maximumEventAge: 60
update_district_slots:
handler: handler.update_district_slots
timeout: 10
maximumRetryAttempts: 0
maximumEventAge: 60
notif_dispatcher:
handler: handler.notif_dispatcher
timeout: 60
maximumRetryAttempts: 0
maximumEventAge: 60
# events:
# - sqs:
# arn: !GetAtt NotificationQueue.Arn
# batchSize: 5
send_batch_email:
handler: handler.send_batch_email
timeout: 20
maximumRetryAttempts: 0
maximumEventAge: 60
verify_email:
handler: handler.verify_email
events:
- http:
path: /verify_email
method: post
cors: true
test_email:
handler: handler.test_email
test_email_pincode:
handler: handler.test_email_pincode
notify_pincode_email:
handler: handler.notify_pincode_email
send_verification_email_manual:
handler: handler.send_verification_email_manual
poller_service_endpoint:
handler: handler.poller_service_endpoint
events:
- http:
path: /cowin_notification
method: post
cors: true
#resources:
# Resources:
# NotificationQueue:
# Type: AWS::SQS::Queue
# Properties:
# VisibilityTimeout: 120
# MessageRetentionPeriod: 120