Amplify-cli: Multiple User Pools Attached to Single API

Created on 16 Jul 2020  路  5Comments  路  Source: aws-amplify/amplify-cli

Although Amplify supports multi-auth and AppSync supports multiple user pools, I cannot seem to use Amplify tooling to connect multiple user pools to a single graphql API.

  1. I cannot connect a user pool using walkthrough steps if my default auth is set to user pools.
    1.5 I can work around this with a custom resource to manually configure AppSync.

  2. Decorating a model with @aws_cognito_user_pools will have no effect as the Query and Mutation resolvers to CRUD my model will not have @aws_cognito_user_pools applied after the schema transformation. No easy workaround.

Is there a weird trick to get multiple pools working with Amplify? Or is there a way to modify parameters files or config files for this to work.

I also couldn't find e2e tests for having user pools as a second auth option.

Which Category is your question related to?
Graphql API, Auth

Amplify CLI Version
4.18

What AWS Services are you utilizing?
Cognito (multiple pools), AppSync

Provide additional details e.g. code snippets

enhancement graphql-transformer

Most helpful comment

I鈥檇 like to do the same. A proper multi tenant solution would be a great feature.

All 5 comments

The Amplify CLI does not currently support connecting multiple user pools to a single GraphQL API.
I'm marking this issue as enhancement.

I am really interested in this feature as well. I have a use case where I want to create a separate user pool for each tenant in my application. Then I would like to authorise based on both the user pool and user pool groups combined.

I鈥檇 like to do the same. A proper multi tenant solution would be a great feature.

I'm also trying to create a multi tenant service and as a workaround I've just set the API to API Key and after user login I include the identity in requests header which I can then use to identify the user on resolver. I'm not sure if this method is safe enough?

This would be very amazing to have - voicing my support

Was this page helpful?
0 / 5 - 0 ratings