-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
79 lines (74 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
74
75
76
77
78
79
service:
name: yyt-message-topic
provider:
name: aws
runtime: nodejs8.10
region: ap-northeast-2
stage: production
tracing:
lambda: true
iamRoleStatements:
- Effect: Allow
Action:
- 'execute-api:ManageConnections'
Resource:
- 'arn:aws:execute-api:*:*:**/@connections/*'
environment:
REDIS_HOST: ${env:REDIS_HOST}
REDIS_PASSWORD: ${env:REDIS_PASSWORD}
AUTH_URL: ${env:AUTH_URL}
API_PATH: ${env:API_PATH}
plugins:
- serverless-webpack
custom:
webpack:
includeModules: # enable auto-packing of external modules
forceExclude:
- aws-sdk
functions:
seeTopicMembers:
handler: src/admin/topic.seeTopicMembers
events:
- http:
method: get
path: redis/{topic}
environment:
ADMIN_SECRET: ${env:ADMIN_SECRET}
deleteTopic:
handler: src/admin/topic.deleteTopic
events:
- http:
method: delete
path: redis/{topic}
environment:
ADMIN_SECRET: ${env:ADMIN_SECRET}
connect:
handler: src/ws/connection.connect
events:
- websocket:
route: $connect
disconnect:
handler: src/ws/connection.disconnect
events:
- websocket:
route: $disconnect
defaultMessages:
handler: src/ws/connection.defaultMessages
events:
- websocket:
route: $default
subscribeTopic:
handler: src/ws/topic.subscribeTopic
events:
- websocket:
route: subscribe
unsubscribeTopic:
handler: src/ws/topic.unsubscribeTopic
events:
- websocket:
route: unsubscribe
broadcastMessage:
handler: src/ws/broadcast.broadcastMessage
events:
- websocket:
route: broadcast