Use existing Cognito resources
Amplify Auth can be configured to use an existing Amazon Cognito user pool and identity pool. If you are in a team setting or part of a company that has previously created auth resources, you can configure the client library directly, or maintain references with AWS Cloud Development Kit (AWS CDK) in your Amplify backend.
Use auth resources without an Amplify backend
You can use existing resources without an Amplify backend by configuring the client library directly.
src/main.ts
import { Amplify } from "aws-amplify"
Amplify.configure({ Auth: { Cognito: { userPoolId: "<your-cognito-user-pool-id>", userPoolClientId: "<your-cognito-user-pool-client-id>", identityPoolId: "<your-cognito-identity-pool-id>", loginWith: { email: true, }, signUpVerificationMethod: "code", userAttributes: { email: { required: true, }, }, allowGuestAccess: true, passwordFormat: { minLength: 8, requireLowercase: true, requireUppercase: true, requireNumbers: true, requireSpecialCharacters: true, }, }, },})