Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silo Multi-tenant Flutter app using AWS Amplify with one frontend #4335

Closed
Vumcam opened this issue Jan 12, 2024 · 5 comments
Closed

Silo Multi-tenant Flutter app using AWS Amplify with one frontend #4335

Vumcam opened this issue Jan 12, 2024 · 5 comments
Assignees
Labels
pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days. question A question about the Amplify Flutter libraries

Comments

@Vumcam
Copy link

Vumcam commented Jan 12, 2024

I'm building a multi-tenant app with Flutter using AWS Amplify.

My regulatory requirement makes it so I must have separate databases and storage(all user data) for each tenant.

The Flutter web version of the app is hosted on AWS Amplify Hosting, so as of now I have a full CI/CD pipeline to commit the app in the staging environment, then make a pull request to deploy it to the production environment.

My issue is, that after creating this process I discovered that each AWS Amplify Frontend can only have 1 backend connected to it.

This makes it impossible(at least from what I know until now) to create multiple backend environments(each environment for each tenant) that have a shared frontend.

My idea was having a prefix that is a name of the tenant in every username, then in the shared login using that prefix I'll authenticate using the matching user pool and then have IAM credentials to access the rest of that tenant environment.

Discovering that you can't(from what I know up to now) connect multiple backend environments to a single frontend made this unfeasible...

Does anyone have an idea of how I can make this happen?

Any help would be very appreciated 🙏

@Jordan-Nelson Jordan-Nelson added question A question about the Amplify Flutter libraries pending-triage This issue is in the backlog of issues to triage labels Jan 12, 2024
@Jordan-Nelson
Copy link
Member

@Vumcam can you explain what you mean by multiple backends? Are you looking to add multiple instances of each category (auth, storage, data) to your amplify app?

This is not something that is supported. One option you could consider is to use separate amplify apps and then load the config for the appropriate app. Please not that Amplify Flutter does not support re-configuration at runtime so you would need to load the appropriate config prior to initializing amplify.

@Jordan-Nelson Jordan-Nelson added Investigating and removed pending-triage This issue is in the backlog of issues to triage labels Jan 12, 2024
@Jordan-Nelson Jordan-Nelson self-assigned this Jan 12, 2024
@Vumcam
Copy link
Author

Vumcam commented Jan 13, 2024

@Jordan-Nelson Like I mentioned in my question, due to regulatory requirements all tenant data must be separated, so what I meant by multiple backends is that each tenant must have its own user pool and databases - therefore I create a single backend for each tenant.

I don't really need to have the functions and APIs separate, but I don't know if you can have multiple databases and storage buckets(the same for each tenant) under 1 backend and also have the automatic deployments.

You nailed it on point with the reconfiguration at runtime which would make what I need possible easily, is this something that is in the works or even feasible with Amplify?
If yes an approximate timeline or any idea about it/feature request maybe would be great.
If no, I'd appreciate if you could aim my in a direction that I maybe could do it in some way using Amplify(you mentioned something about separate amplify apps, if you could elaborate), or using plain AWS without Amplify is the way to go?
Thanks.

@Jordan-Nelson
Copy link
Member

@Vumcam - We are tracking the feature request for runtime reconfiguration here: #1902.

We do not have a timeline for this at the moment. You can give the issue description a 👍 to express your interest and follow the issue for updates.

Let me know if you have any other questions.

@Jordan-Nelson Jordan-Nelson added pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days. and removed Investigating labels Jan 16, 2024
@Vumcam
Copy link
Author

Vumcam commented Jan 16, 2024

Ok, great.
Thank you, hope this will be soon 🙏

@Jordan-Nelson
Copy link
Member

I see your comment on that issue. I am going to close this issue out since I believe the question was answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days. question A question about the Amplify Flutter libraries
Projects
None yet
Development

No branches or pull requests

2 participants