Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (72 sloc) 1.69 KB
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
You can’t perform that action at this time.