How can multi-tenancy be effectively managed in an AWS Amplify application?

0

We're leveraging an AWS Amplify React application in the Mumbai region (ap-south-1). Our application utilizes AWS DynamoDB for data storage. Our current challenge involves storing data for multiple customers in DynamoDB tables. How should we handle this data in API calls, especially with our need to support **multi-tenancy **in the application?

2 Answers
0

There is not a lot of information in your question, but based on what you provided I see here two options.

  1. Use tenant_id as one of the attributes in dynamo table. Depends on your use-case , you may decided (or may not) to use it as Secondary Index.
  2. If you traffic goes through API Gateway you can attach the API key to the request from the client. More information can be found https://aws.amazon.com/blogs/compute/managing-multi-tenant-apis-using-amazon-api-gateway/
AWS
Mi_Sha
answered a month ago
0

Amplify not supporting multi tenancy but there are couple of methods to achieve multi tenancy in Amplify App. You may check the feature request Support multi-tenant.

We could use Cognito user pool groups and when user created through Amplify Auth we can add user to specific Cognito User Pool groups of tenant. To implement this you can refer Amplify CLI enables creating Amazon Cognito User Pool Groups, configuring fine-grained permissions on groups, and adding user management capabilities to applications and define AppSync schema Auth rules as per user group data access. For more information on Groups based data access configuration you may refer user-group-based-data-access

Additionally, you may refer third-party blogs An updated guide on simple multitenant architecture using AWS Amplify and React Native Expo and Multi-Tenant AWS Amplify.

In summary, there isn't any ideal way to implement this in Amplify and I hope the above information was helpful to you.

AWS
SUPPORT ENGINEER
answered a month ago