When creating a SaaS multi-tenant systems which require websocket connections we need a way to rate limit those connections on a per tenant basis. With Amazon API Gateway you have the option to use usage plans with HTTP connections however they are not available for websockets. To enable rate limiting we can use a API Gateway Lambda Authorizer to validate a connection and control access. Using a Lambda Authorizer we can implement code to allow the system to valid connection rates and throttle inbound connections on a per tenant basis. This sample also demonstrates pool and silo modes for handling the message traffic per tenant.
Stars
36
Forks
4
Watchers
36
Open Issues
0
Overall repository health assessment
No package.json found
This might not be a Node.js project
44
commits
1
commits
Adding a role for each lambda execution to allow for the assume role action to add tenant info
a54605cView on GitHubUpdating the readme to clarify details of each step in the architecture
dd1060cView on GitHubEscaping results of the tenant fetch to clear up cross site scripting
b7488fbView on GitHubUpdating the limit table to have a tenant id AND sort key to make sure tenant isolation exists
02ee6d9View on GitHubUpdate to the message group Id with tenant and session Id
21bb2d6View on GitHubUpdating to remove the default route and put in a pooled and siloed SQS FIFO queue to streamline the sample for multi tenancy
a352c57View on GitHubAdding a default template selection so its easier to see in the console
e0ec7dfView on GitHub