-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
48 lines (46 loc) · 1.17 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
service: aws-node-websockets
provider:
name: aws
runtime: nodejs8.10
memorySize: 128
stage: ${file(env.yml):stage}
region: ${file(env.yml):region}
environment:
dynamodb: ${self:service}-${opt:stage, self:provider.stage}
stage: ${self:provider.stage}
region: ${self:provider.region}
iamRoleStatements:
- Effect: Allow
Action: "*"
Resource: "arn:aws:dynamodb:${self:provider.environment.region}:*:table/${self:provider.environment.dynamodb}"
functions:
connect:
handler: handler.connect
events:
- websocket:
route: $connect
disconnect:
handler: handler.disconnect
events:
- websocket:
route: $disconnect
default:
handler: handler.default
events:
- websocket:
route: $default
resources:
Resources:
connectionsDynamodb:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
-
AttributeName: connectionId
AttributeType: S
KeySchema:
-
AttributeName: connectionId
KeyType: HASH
BillingMode: PAY_PER_REQUEST
TableName: ${self:provider.environment.dynamodb}