Skip to content

Instantly share code, notes, and snippets.

@leantorres73
Created January 14, 2021 15:35
Show Gist options
  • Save leantorres73/f4978511b913a48a07160c950e781c98 to your computer and use it in GitHub Desktop.
Save leantorres73/f4978511b913a48a07160c950e781c98 to your computer and use it in GitHub Desktop.
dynamodb
const wsConnections = new dynamodb.Table(this, 'WSconnections', {
tableName: 'ws-connections',
partitionKey: { name: 'userId', type: dynamodb.AttributeType.STRING },
sortKey: { name: 'connectionId', type: dynamodb.AttributeType.STRING },
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
stream: dynamodb.StreamViewType.NEW_IMAGE
});
wsConnections.addGlobalSecondaryIndex({
indexName: 'connectionId',
partitionKey: {
name: 'connectionId',
type: dynamodb.AttributeType.STRING
}
});
wsConnections.grantReadWriteData(lambdaAPIsocket);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment