-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
76 lines (72 loc) · 1.69 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
service: noco-sls-chat
provider:
name: aws
frameworkVersion: "=1.50.0"
logRetentionInDays: 14
region: ${env:AWS_REGION}
runtime: python3.6
stage: ${env:ENV}
timeout: 6
versionFunctions: false
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:*"
Resource: !GetAtt ConnectionsTable.Arn
environment:
DYNAMO_TABLE_NAME: !Ref ConnectionsTable
# These are some sane excludes for Python
package:
exclude:
- "**/__pycache__/**"
- "*.pyc"
- "*.swp"
- package-lock.json
- package.json
- .git/**
- __pycache__/**
- node_modules/**
- lib/**
- build/**
resources:
Resources:
ConnectionsTable:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: pk
AttributeType: S
- AttributeName: epoch
AttributeType: N
KeySchema:
- AttributeName: pk
KeyType: HASH
- AttributeName: epoch
KeyType: RANGE
functions:
connect:
handler: handler.connect
layers:
- arn:aws:lambda:us-west-2:420819310858:layer:boto3-botocore:1
events:
- websocket: $connect
disconnect:
handler: handler.disconnect
layers:
- arn:aws:lambda:us-west-2:420819310858:layer:boto3-botocore:1
events:
- websocket: $disconnect
command:
handler: handler.handle_cmd
layers:
- arn:aws:lambda:us-west-2:420819310858:layer:boto3-botocore:1
events:
- websocket:
route: command
default:
handler: handler.default
layers:
- arn:aws:lambda:us-west-2:420819310858:layer:boto3-botocore:1
events:
- websocket: $default