Class UserPoolProps.Builder
java.lang.Object
software.amazon.awscdk.services.cognito.UserPoolProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<UserPoolProps>
- Enclosing interface:
UserPoolProps
@Stability(Stable)
public static final class UserPoolProps.Builder
extends Object
implements software.amazon.jsii.Builder<UserPoolProps>
A builder for
UserPoolProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccountRecovery(AccountRecovery accountRecovery) Sets the value ofUserPoolProps.getAccountRecovery()advancedSecurityMode(AdvancedSecurityMode advancedSecurityMode) Deprecated.Advanced Security Mode is deprecated due to user pool feature plans.autoVerify(AutoVerifiedAttrs autoVerify) Sets the value ofUserPoolProps.getAutoVerify()build()Builds the configured instance.customAttributes(Map<String, ? extends ICustomAttribute> customAttributes) Sets the value ofUserPoolProps.getCustomAttributes()customSenderKmsKey(IKeyRef customSenderKmsKey) Sets the value ofUserPoolProps.getCustomSenderKmsKey()customThreatProtectionMode(CustomThreatProtectionMode customThreatProtectionMode) Sets the value ofUserPoolProps.getCustomThreatProtectionMode()deletionProtection(Boolean deletionProtection) Sets the value ofUserPoolProps.getDeletionProtection()deviceTracking(DeviceTracking deviceTracking) Sets the value ofUserPoolProps.getDeviceTracking()email(UserPoolEmail email) Sets the value ofUserPoolProps.getEmail()enableSmsRole(Boolean enableSmsRole) Sets the value ofUserPoolProps.getEnableSmsRole()featurePlan(FeaturePlan featurePlan) Sets the value ofUserPoolProps.getFeaturePlan()keepOriginal(KeepOriginalAttrs keepOriginal) Sets the value ofUserPoolProps.getKeepOriginal()lambdaTriggers(UserPoolTriggers lambdaTriggers) Sets the value ofUserPoolProps.getLambdaTriggers()Sets the value ofUserPoolProps.getMfa()mfaMessage(String mfaMessage) Sets the value ofUserPoolProps.getMfaMessage()mfaSecondFactor(MfaSecondFactor mfaSecondFactor) Sets the value ofUserPoolProps.getMfaSecondFactor()passkeyRelyingPartyId(String passkeyRelyingPartyId) Sets the value ofUserPoolProps.getPasskeyRelyingPartyId()passkeyUserVerification(PasskeyUserVerification passkeyUserVerification) Sets the value ofUserPoolProps.getPasskeyUserVerification()passwordPolicy(PasswordPolicy passwordPolicy) Sets the value ofUserPoolProps.getPasswordPolicy()removalPolicy(RemovalPolicy removalPolicy) Sets the value ofUserPoolProps.getRemovalPolicy()selfSignUpEnabled(Boolean selfSignUpEnabled) Sets the value ofUserPoolProps.getSelfSignUpEnabled()signInAliases(SignInAliases signInAliases) Sets the value ofUserPoolProps.getSignInAliases()signInCaseSensitive(Boolean signInCaseSensitive) Sets the value ofUserPoolProps.getSignInCaseSensitive()signInPolicy(SignInPolicy signInPolicy) Sets the value ofUserPoolProps.getSignInPolicy()Sets the value ofUserPoolProps.getSmsRole()smsRoleExternalId(String smsRoleExternalId) Sets the value ofUserPoolProps.getSmsRoleExternalId()Sets the value ofUserPoolProps.getSnsRegion()standardAttributes(StandardAttributes standardAttributes) Sets the value ofUserPoolProps.getStandardAttributes()standardThreatProtectionMode(StandardThreatProtectionMode standardThreatProtectionMode) Sets the value ofUserPoolProps.getStandardThreatProtectionMode()userInvitation(UserInvitationConfig userInvitation) Sets the value ofUserPoolProps.getUserInvitation()userPoolName(String userPoolName) Sets the value ofUserPoolProps.getUserPoolName()userVerification(UserVerificationConfig userVerification) Sets the value ofUserPoolProps.getUserVerification()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
accountRecovery
Sets the value ofUserPoolProps.getAccountRecovery()- Parameters:
accountRecovery- How will a user be able to recover their account?.- Returns:
this
-
advancedSecurityMode
@Stability(Deprecated) @Deprecated public UserPoolProps.Builder advancedSecurityMode(AdvancedSecurityMode advancedSecurityMode) Deprecated.Advanced Security Mode is deprecated due to user pool feature plans. Use StandardThreatProtectionMode and CustomThreatProtectionMode to set Thread Protection level.Sets the value ofUserPoolProps.getAdvancedSecurityMode()- Parameters:
advancedSecurityMode- The user pool's Advanced Security Mode.- Returns:
this
-
autoVerify
Sets the value ofUserPoolProps.getAutoVerify()- Parameters:
autoVerify- Attributes which Cognito will look to verify automatically upon user sign up. EMAIL and PHONE are the only available options.- Returns:
this
-
customAttributes
@Stability(Stable) public UserPoolProps.Builder customAttributes(Map<String, ? extends ICustomAttribute> customAttributes) Sets the value ofUserPoolProps.getCustomAttributes()- Parameters:
customAttributes- Define a set of custom attributes that can be configured for each user in the user pool.- Returns:
this
-
customSenderKmsKey
Sets the value ofUserPoolProps.getCustomSenderKmsKey()- Parameters:
customSenderKmsKey- This key will be used to encrypt temporary passwords and authorization codes that Amazon Cognito generates.- Returns:
this
-
customThreatProtectionMode
@Stability(Stable) public UserPoolProps.Builder customThreatProtectionMode(CustomThreatProtectionMode customThreatProtectionMode) Sets the value ofUserPoolProps.getCustomThreatProtectionMode()- Parameters:
customThreatProtectionMode- The Type of Threat Protection Enabled for Custom Authentication. This feature only functions if your FeaturePlan is set to FeaturePlan.PLUS- Returns:
this
-
deletionProtection
Sets the value ofUserPoolProps.getDeletionProtection()- Parameters:
deletionProtection- Indicates whether the user pool should have deletion protection enabled.- Returns:
this
-
deviceTracking
Sets the value ofUserPoolProps.getDeviceTracking()- Parameters:
deviceTracking- Device tracking settings.- Returns:
this
-
email
Sets the value ofUserPoolProps.getEmail()- Parameters:
email- Email settings for a user pool.- Returns:
this
-
enableSmsRole
Sets the value ofUserPoolProps.getEnableSmsRole()- Parameters:
enableSmsRole- Setting this would explicitly enable or disable SMS role creation. When left unspecified, CDK will determine based on other properties if a role is needed or not.- Returns:
this
-
featurePlan
Sets the value ofUserPoolProps.getFeaturePlan()- Parameters:
featurePlan- The user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection.- Returns:
this
-
keepOriginal
Sets the value ofUserPoolProps.getKeepOriginal()- Parameters:
keepOriginal- Attributes which Cognito will look to handle changes to the value of your users' email address and phone number attributes. EMAIL and PHONE are the only available options.- Returns:
this
-
lambdaTriggers
Sets the value ofUserPoolProps.getLambdaTriggers()- Parameters:
lambdaTriggers- Lambda functions to use for supported Cognito triggers.- Returns:
this
-
mfa
Sets the value ofUserPoolProps.getMfa()- Parameters:
mfa- Configure whether users of this user pool can or are required use MFA to sign in.- Returns:
this
-
mfaMessage
Sets the value ofUserPoolProps.getMfaMessage()- Parameters:
mfaMessage- The SMS message template sent during MFA verification. Use '{####}' in the template where Cognito should insert the verification code.- Returns:
this
-
mfaSecondFactor
Sets the value ofUserPoolProps.getMfaSecondFactor()- Parameters:
mfaSecondFactor- Configure the MFA types that users can use in this user pool. Ignored ifmfais set toOFF.- Returns:
this
-
passkeyRelyingPartyId
Sets the value ofUserPoolProps.getPasskeyRelyingPartyId()- Parameters:
passkeyRelyingPartyId- The authentication domain that passkey providers must use as a relying party (RP) in their configuration. Under the following conditions, the passkey relying party ID must be the fully-qualified domain name of your custom domain:- The user pool is configured for passkey authentication.
- The user pool has a custom domain, whether or not it also has a prefix domain.
- Your application performs authentication with managed login or the classic hosted UI.
- Returns:
this
-
passkeyUserVerification
@Stability(Stable) public UserPoolProps.Builder passkeyUserVerification(PasskeyUserVerification passkeyUserVerification) Sets the value ofUserPoolProps.getPasskeyUserVerification()- Parameters:
passkeyUserVerification- Your user-pool treatment for MFA with a passkey. You can override other MFA options and require passkey MFA, or you can set it as preferred. When passkey MFA is preferred, the hosted UI encourages users to register a passkey at sign-in.- Returns:
this
-
passwordPolicy
Sets the value ofUserPoolProps.getPasswordPolicy()- Parameters:
passwordPolicy- Password policy for this user pool.- Returns:
this
-
removalPolicy
Sets the value ofUserPoolProps.getRemovalPolicy()- Parameters:
removalPolicy- Policy to apply when the user pool is removed from the stack.- Returns:
this
-
selfSignUpEnabled
Sets the value ofUserPoolProps.getSelfSignUpEnabled()- Parameters:
selfSignUpEnabled- Whether self sign-up should be enabled. To configure self sign-up configuration use theuserVerificationproperty.- Returns:
this
-
signInAliases
Sets the value ofUserPoolProps.getSignInAliases()- Parameters:
signInAliases- Methods in which a user registers or signs in to a user pool. Allows either username with aliases OR sign in with email, phone, or both.Read the sections on usernames and aliases to learn more - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html
To match with 'Option 1' in the above link, with a verified email, this property should be set to
{ username: true, email: true }. To match with 'Option 2' in the above link with both a verified email and phone number, this property should be set to{ email: true, phone: true }.- Returns:
this
-
signInCaseSensitive
Sets the value ofUserPoolProps.getSignInCaseSensitive()- Parameters:
signInCaseSensitive- Whether sign-in aliases should be evaluated with case sensitivity. For example, when this option is set to false, users will be able to sign in using eitherMyUsernameormyusername.- Returns:
this
-
signInPolicy
Sets the value ofUserPoolProps.getSignInPolicy()- Parameters:
signInPolicy- Sign-in policy for this user pool.- Returns:
this
-
smsRole
Sets the value ofUserPoolProps.getSmsRole()- Parameters:
smsRole- The IAM role that Cognito will assume while sending SMS messages.- Returns:
this
-
smsRoleExternalId
Sets the value ofUserPoolProps.getSmsRoleExternalId()- Parameters:
smsRoleExternalId- The 'ExternalId' that Cognito service must be using when assuming thesmsRole, if the role is restricted with an 'sts:ExternalId' conditional. Learn more about ExternalId here - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.htmlThis property will be ignored if
smsRoleis not specified.- Returns:
this
-
snsRegion
Sets the value ofUserPoolProps.getSnsRegion()- Parameters:
snsRegion- The region to integrate with SNS to send SMS messages. This property will do nothing if SMS configuration is not configured.- Returns:
this
-
standardAttributes
@Stability(Stable) public UserPoolProps.Builder standardAttributes(StandardAttributes standardAttributes) Sets the value ofUserPoolProps.getStandardAttributes()- Parameters:
standardAttributes- The set of attributes that are required for every user in the user pool. Read more on attributes here - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html- Returns:
this
-
standardThreatProtectionMode
@Stability(Stable) public UserPoolProps.Builder standardThreatProtectionMode(StandardThreatProtectionMode standardThreatProtectionMode) Sets the value ofUserPoolProps.getStandardThreatProtectionMode()- Parameters:
standardThreatProtectionMode- The Type of Threat Protection Enabled for Standard Authentication. This feature only functions if your FeaturePlan is set to FeaturePlan.PLUS- Returns:
this
-
userInvitation
Sets the value ofUserPoolProps.getUserInvitation()- Parameters:
userInvitation- Configuration around admins signing up users into a user pool.- Returns:
this
-
userPoolName
Sets the value ofUserPoolProps.getUserPoolName()- Parameters:
userPoolName- Name of the user pool.- Returns:
this
-
userVerification
@Stability(Stable) public UserPoolProps.Builder userVerification(UserVerificationConfig userVerification) Sets the value ofUserPoolProps.getUserVerification()- Parameters:
userVerification- Configuration around users signing themselves up to the user pool. Enable or disable self sign-up via theselfSignUpEnabledproperty.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<UserPoolProps>- Returns:
- a new instance of
UserPoolProps - Throws:
NullPointerException- if any required attribute was not provided
-