Created
January 14, 2021 15:35
-
-
Save leantorres73/f4978511b913a48a07160c950e781c98 to your computer and use it in GitHub Desktop.
dynamodb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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