Open
Description
Environment information
n/a
Describe the feature
lifting this comment from the referenceAuth RFC into its own feature request
#1548 (comment)
Scenario:
- We deploy App1 and with it a UserPool, IdentityPool, and UserPoolClient. The app matures and accumulates users.
- We conceive of some new functionality that is related to App1 but not exactly the same app. So we deploy App2 that offers the same user base new functionality. App1 and App2 are separate enough that they should not be rolled into one deployment and have different release cycles.
- We want to reuse the UserPool in App1 since both apps are used by the same users...however we want to create a new IdentityPool and a new UserPoolClient for App2.
// amplify/auth/resource.ts
import { referenceAuth } from "@aws-amplify/backend"
export const auth = referenceAuth({
userPoolId: "...",
})
Referencing by only the user pool ID will create new resources:
- identity pool
- authenticated role
- unauthenticated role
- user pool client
Each of these new resources will enable scoping policies to only interact with resources within the Amplify app
Use case
see above