Class UserPool
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.cognito.UserPool
- All Implemented Interfaces:
IResource,IUserPool,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:35.407Z")
@Stability(Stable)
public class UserPool
extends Resource
implements IUserPool
Define a Cognito User Pool.
Example:
UserPool pool = new UserPool(this, "Pool");
pool.addClient("app-client", UserPoolClientOptions.builder()
.oAuth(OAuthSettings.builder()
.flows(OAuthFlows.builder()
.authorizationCodeGrant(true)
.build())
.scopes(List.of(OAuthScope.OPENID))
.callbackUrls(List.of("https://my-app-domain.com/welcome"))
.logoutUrls(List.of("https://my-app-domain.com/signin"))
.build())
.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.cognito.IUserPool
IUserPool.Jsii$Default, IUserPool.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUserPool(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedUserPool(software.amazon.jsii.JsiiObjectRef objRef) UserPool(software.constructs.Construct scope, String id, UserPoolProps props) -
Method Summary
Modifier and TypeMethodDescriptionAdd a new app client to this user pool.addClient(String id, UserPoolClientOptions options) Add a new app client to this user pool.addDomain(String id, UserPoolDomainOptions options) Associate a domain to this user pool.addGroup(String id, UserPoolGroupOptions options) Add a new group to this user pool.addResourceServer(String id, UserPoolResourceServerOptions options) Add a new resource server to this user pool.voidaddTrigger(UserPoolOperation operation, IFunction fn) Add a lambda trigger to a user pool operation.voidaddTrigger(UserPoolOperation operation, IFunction fn, LambdaVersion lambdaVersion) Add a lambda trigger to a user pool operation.static IUserPoolfromUserPoolArn(software.constructs.Construct scope, String id, String userPoolArn) Import an existing user pool based on its ARN.static IUserPoolfromUserPoolId(software.constructs.Construct scope, String id, String userPoolId) Import an existing user pool based on its id.Get all identity providers registered with this user pool.The ARN of the user pool.The physical ID of this user pool resource.User pool provider name.User pool provider URL.grant(IGrantable grantee, String... actions) Adds an IAM policy statement associated with this user pool to an IAM principal's policy.voidRegister an identity provider with this user pool.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
UserPool
protected UserPool(software.amazon.jsii.JsiiObjectRef objRef) -
UserPool
protected UserPool(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
UserPool
@Stability(Stable) public UserPool(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable UserPoolProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
UserPool
@Stability(Stable) public UserPool(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromUserPoolArn
@Stability(Stable) @NotNull public static IUserPool fromUserPoolArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String userPoolArn) Import an existing user pool based on its ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.userPoolArn- This parameter is required.
-
fromUserPoolId
@Stability(Stable) @NotNull public static IUserPool fromUserPoolId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String userPoolId) Import an existing user pool based on its id.- Parameters:
scope- This parameter is required.id- This parameter is required.userPoolId- This parameter is required.
-
addClient
@Stability(Stable) @NotNull public UserPoolClient addClient(@NotNull String id, @Nullable UserPoolClientOptions options) Add a new app client to this user pool. -
addClient
Add a new app client to this user pool. -
addDomain
@Stability(Stable) @NotNull public UserPoolDomain addDomain(@NotNull String id, @NotNull UserPoolDomainOptions options) Associate a domain to this user pool. -
addGroup
@Stability(Stable) @NotNull public UserPoolGroup addGroup(@NotNull String id, @NotNull UserPoolGroupOptions options) Add a new group to this user pool. -
addResourceServer
@Stability(Stable) @NotNull public UserPoolResourceServer addResourceServer(@NotNull String id, @NotNull UserPoolResourceServerOptions options) Add a new resource server to this user pool.- Specified by:
addResourceServerin interfaceIUserPool- Parameters:
id- This parameter is required.options- This parameter is required.- See Also:
-
addTrigger
@Stability(Stable) public void addTrigger(@NotNull UserPoolOperation operation, @NotNull IFunction fn, @Nullable LambdaVersion lambdaVersion) Add a lambda trigger to a user pool operation.- Parameters:
operation- This parameter is required.fn- This parameter is required.lambdaVersion-- See Also:
-
addTrigger
@Stability(Stable) public void addTrigger(@NotNull UserPoolOperation operation, @NotNull IFunction fn) Add a lambda trigger to a user pool operation.- Parameters:
operation- This parameter is required.fn- This parameter is required.- See Also:
-
grant
@Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions) Adds an IAM policy statement associated with this user pool to an IAM principal's policy. -
registerIdentityProvider
@Stability(Stable) public void registerIdentityProvider(@NotNull IUserPoolIdentityProvider provider) Register an identity provider with this user pool.- Specified by:
registerIdentityProviderin interfaceIUserPool- Parameters:
provider- This parameter is required.
-
getIdentityProviders
Get all identity providers registered with this user pool.- Specified by:
getIdentityProvidersin interfaceIUserPool
-
getUserPoolArn
The ARN of the user pool.- Specified by:
getUserPoolArnin interfaceIUserPool
-
getUserPoolId
The physical ID of this user pool resource.- Specified by:
getUserPoolIdin interfaceIUserPool
-
getUserPoolProviderName
User pool provider name.- Specified by:
getUserPoolProviderNamein interfaceIUserPool
-
getUserPoolProviderUrl
User pool provider URL.
-