Skip to content

Instantly share code, notes, and snippets.

@SumindaD
Created September 25, 2019 07:09
Show Gist options
  • Save SumindaD/f7f9c65889c91ff29498039c62cf3676 to your computer and use it in GitHub Desktop.
Save SumindaD/f7f9c65889c91ff29498039c62cf3676 to your computer and use it in GitHub Desktop.
import json
import boto3
import os
dynamodb = boto3.client('dynamodb')
def handle(event, context):
connectionId = event['requestContext']['connectionId']
# Delete connectionId from the database
dynamodb.delete_item(TableName=os.environ['SOCKET_CONNECTIONS_TABLE_NAME'], Key={'connectionId': {'S': connectionId}})
return {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment