Interface UserPoolDomainProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable,UserPoolDomainOptions
- All Known Implementing Classes:
UserPoolDomainProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:01.612Z")
@Stability(Stable)
public interface UserPoolDomainProps
extends software.amazon.jsii.JsiiSerializable, UserPoolDomainOptions
Props for UserPoolDomain construct.
Example:
import software.amazon.awscdk.services.certificatemanager.*;
Vpc vpc;
Certificate certificate;
ApplicationLoadBalancer lb = ApplicationLoadBalancer.Builder.create(this, "LB")
.vpc(vpc)
.internetFacing(true)
.build();
UserPool userPool = new UserPool(this, "UserPool");
UserPoolClient userPoolClient = UserPoolClient.Builder.create(this, "Client")
.userPool(userPool)
// Required minimal configuration for use with an ELB
.generateSecret(true)
.authFlows(AuthFlow.builder()
.userPassword(true)
.build())
.oAuth(OAuthSettings.builder()
.flows(OAuthFlows.builder()
.authorizationCodeGrant(true)
.build())
.scopes(List.of(OAuthScope.EMAIL))
.callbackUrls(List.of(String.format("https://%s/oauth2/idpresponse", lb.getLoadBalancerDnsName())))
.build())
.build();
CfnUserPoolClient cfnClient = (CfnUserPoolClient)userPoolClient.getNode().getDefaultChild();
cfnClient.addPropertyOverride("RefreshTokenValidity", 1);
cfnClient.addPropertyOverride("SupportedIdentityProviders", List.of("COGNITO"));
UserPoolDomain userPoolDomain = UserPoolDomain.Builder.create(this, "Domain")
.userPool(userPool)
.cognitoDomain(CognitoDomainOptions.builder()
.domainPrefix("test-cdk-prefix")
.build())
.build();
lb.addListener("Listener", BaseApplicationListenerProps.builder()
.port(443)
.certificates(List.of(certificate))
.defaultAction(AuthenticateCognitoAction.Builder.create()
.userPool(userPool)
.userPoolClient(userPoolClient)
.userPoolDomain(userPoolDomain)
.next(ListenerAction.fixedResponse(200, FixedResponseOptions.builder()
.contentType("text/plain")
.messageBody("Authenticated")
.build()))
.build())
.build());
CfnOutput.Builder.create(this, "DNS")
.value(lb.getLoadBalancerDnsName())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forUserPoolDomainPropsstatic final classAn implementation forUserPoolDomainProps -
Method Summary
Modifier and TypeMethodDescriptionstatic UserPoolDomainProps.Builderbuilder()The user pool to which this domain should be associated.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.cognito.UserPoolDomainOptions
getCognitoDomain, getCustomDomain, getManagedLoginVersion
-
Method Details
-
getUserPool
The user pool to which this domain should be associated. -
builder
- Returns:
- a
UserPoolDomainProps.BuilderofUserPoolDomainProps
-