Skip to content

support referenceAuth with only user pool, create new identity pool, roles, user pool client #2252

Open
@josefaidt

Description

@josefaidt

Environment information

n/a

Describe the feature

lifting this comment from the referenceAuth RFC into its own feature request
#1548 (comment)

Scenario:

  1. We deploy App1 and with it a UserPool, IdentityPool, and UserPoolClient. The app matures and accumulates users.
  2. 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.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssue pertaining to Amplify Authfeature-requestNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions