public static final class UserPoolProps.Builder
extends java.lang.Object
UserPoolProps
Constructor and Description |
---|
Builder() |
public UserPoolProps.Builder accountRecovery(AccountRecovery accountRecovery)
UserPoolProps.getAccountRecovery()
accountRecovery
- How will a user be able to recover their account?.this
public UserPoolProps.Builder autoVerify(AutoVerifiedAttrs autoVerify)
UserPoolProps.getAutoVerify()
autoVerify
- Attributes which Cognito will look to verify automatically upon user sign up.
EMAIL and PHONE are the only available options.this
public UserPoolProps.Builder customAttributes(java.util.Map<java.lang.String,? extends ICustomAttribute> customAttributes)
UserPoolProps.getCustomAttributes()
customAttributes
- Define a set of custom attributes that can be configured for each user in the user pool.this
public UserPoolProps.Builder customSenderKmsKey(IKey customSenderKmsKey)
UserPoolProps.getCustomSenderKmsKey()
customSenderKmsKey
- This key will be used to encrypt temporary passwords and authorization codes that Amazon Cognito generates.this
public UserPoolProps.Builder deviceTracking(DeviceTracking deviceTracking)
UserPoolProps.getDeviceTracking()
deviceTracking
- Device tracking settings.this
public UserPoolProps.Builder email(UserPoolEmail email)
UserPoolProps.getEmail()
email
- Email settings for a user pool.this
@Deprecated public UserPoolProps.Builder emailSettings(EmailSettings emailSettings)
UserPoolProps.getEmailSettings()
emailSettings
- Email settings for a user pool.this
public UserPoolProps.Builder enableSmsRole(java.lang.Boolean enableSmsRole)
UserPoolProps.getEnableSmsRole()
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.this
public UserPoolProps.Builder lambdaTriggers(UserPoolTriggers lambdaTriggers)
UserPoolProps.getLambdaTriggers()
lambdaTriggers
- Lambda functions to use for supported Cognito triggers.this
public UserPoolProps.Builder mfa(Mfa mfa)
UserPoolProps.getMfa()
mfa
- Configure whether users of this user pool can or are required use MFA to sign in.this
public UserPoolProps.Builder mfaMessage(java.lang.String mfaMessage)
UserPoolProps.getMfaMessage()
mfaMessage
- The SMS message template sent during MFA verification.
Use '{####}' in the template where Cognito should insert the verification code.this
public UserPoolProps.Builder mfaSecondFactor(MfaSecondFactor mfaSecondFactor)
UserPoolProps.getMfaSecondFactor()
mfaSecondFactor
- Configure the MFA types that users can use in this user pool.
Ignored if mfa
is set to OFF
.this
public UserPoolProps.Builder passwordPolicy(PasswordPolicy passwordPolicy)
UserPoolProps.getPasswordPolicy()
passwordPolicy
- Password policy for this user pool.this
public UserPoolProps.Builder removalPolicy(RemovalPolicy removalPolicy)
UserPoolProps.getRemovalPolicy()
removalPolicy
- Policy to apply when the user pool is removed from the stack.this
public UserPoolProps.Builder selfSignUpEnabled(java.lang.Boolean selfSignUpEnabled)
UserPoolProps.getSelfSignUpEnabled()
selfSignUpEnabled
- Whether self sign up should be enabled.
This can be further configured via the selfSignUp
property.this
public UserPoolProps.Builder signInAliases(SignInAliases signInAliases)
UserPoolProps.getSignInAliases()
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 }
.
this
public UserPoolProps.Builder signInCaseSensitive(java.lang.Boolean signInCaseSensitive)
UserPoolProps.getSignInCaseSensitive()
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 either MyUsername
or myusername
.this
public UserPoolProps.Builder smsRole(IRole smsRole)
UserPoolProps.getSmsRole()
smsRole
- The IAM role that Cognito will assume while sending SMS messages.this
public UserPoolProps.Builder smsRoleExternalId(java.lang.String smsRoleExternalId)
UserPoolProps.getSmsRoleExternalId()
smsRoleExternalId
- The 'ExternalId' that Cognito service must using when assuming the `smsRole`, 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.html
This property will be ignored if smsRole
is not specified.
this
public UserPoolProps.Builder snsRegion(java.lang.String snsRegion)
UserPoolProps.getSnsRegion()
snsRegion
- The region to integrate with SNS to send SMS messages.
This property will do nothing if SMS configuration is not configuredthis
public UserPoolProps.Builder standardAttributes(StandardAttributes standardAttributes)
UserPoolProps.getStandardAttributes()
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.htmlthis
public UserPoolProps.Builder userInvitation(UserInvitationConfig userInvitation)
UserPoolProps.getUserInvitation()
userInvitation
- Configuration around admins signing up users into a user pool.this
public UserPoolProps.Builder userPoolName(java.lang.String userPoolName)
UserPoolProps.getUserPoolName()
userPoolName
- Name of the user pool.this
public UserPoolProps.Builder userVerification(UserVerificationConfig userVerification)
UserPoolProps.getUserVerification()
userVerification
- Configuration around users signing themselves up to the user pool.
Enable or disable self sign-up via the selfSignUpEnabled
property.this
public UserPoolProps build()
UserPoolProps
java.lang.NullPointerException
- if any required attribute was not provided