Class CfnUserPool.Builder

java.lang.Object
software.amazon.awscdk.services.cognito.CfnUserPool.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnUserPool>
Enclosing class:
CfnUserPool

@Stability(Stable) public static final class CfnUserPool.Builder extends Object implements software.amazon.jsii.Builder<CfnUserPool>
A fluent builder for CfnUserPool.
  • Method Details

    • create

      @Stability(Stable) public static CfnUserPool.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnUserPool.Builder.
    • accountRecoverySetting

      @Stability(Stable) public CfnUserPool.Builder accountRecoverySetting(IResolvable accountRecoverySetting)
      Use this setting to define which verified available method a user can use to recover their password when they call ForgotPassword .

      It allows you to define a preferred method when a user has more than one method available. With this setting, SMS does not qualify for a valid password recovery mechanism if the user also has SMS MFA enabled. In the absence of this setting, Cognito uses the legacy behavior to determine the recovery method where SMS is preferred over email.

      Parameters:
      accountRecoverySetting - Use this setting to define which verified available method a user can use to recover their password when they call ForgotPassword . This parameter is required.
      Returns:
      this
    • accountRecoverySetting

      @Stability(Stable) public CfnUserPool.Builder accountRecoverySetting(CfnUserPool.AccountRecoverySettingProperty accountRecoverySetting)
      Use this setting to define which verified available method a user can use to recover their password when they call ForgotPassword .

      It allows you to define a preferred method when a user has more than one method available. With this setting, SMS does not qualify for a valid password recovery mechanism if the user also has SMS MFA enabled. In the absence of this setting, Cognito uses the legacy behavior to determine the recovery method where SMS is preferred over email.

      Parameters:
      accountRecoverySetting - Use this setting to define which verified available method a user can use to recover their password when they call ForgotPassword . This parameter is required.
      Returns:
      this
    • adminCreateUserConfig

      @Stability(Stable) public CfnUserPool.Builder adminCreateUserConfig(IResolvable adminCreateUserConfig)
      The configuration for creating a new user profile.

      Parameters:
      adminCreateUserConfig - The configuration for creating a new user profile. This parameter is required.
      Returns:
      this
    • adminCreateUserConfig

      @Stability(Stable) public CfnUserPool.Builder adminCreateUserConfig(CfnUserPool.AdminCreateUserConfigProperty adminCreateUserConfig)
      The configuration for creating a new user profile.

      Parameters:
      adminCreateUserConfig - The configuration for creating a new user profile. This parameter is required.
      Returns:
      this
    • aliasAttributes

      @Stability(Stable) public CfnUserPool.Builder aliasAttributes(List<String> aliasAttributes)
      Attributes supported as an alias for this user pool. Possible values: phone_number , email , or preferred_username .

      This user pool property cannot be updated.

      Parameters:
      aliasAttributes - Attributes supported as an alias for this user pool. Possible values: phone_number , email , or preferred_username . This parameter is required.
      Returns:
      this
    • autoVerifiedAttributes

      @Stability(Stable) public CfnUserPool.Builder autoVerifiedAttributes(List<String> autoVerifiedAttributes)
      The attributes to be auto-verified.

      Possible values: email , phone_number .

      Parameters:
      autoVerifiedAttributes - The attributes to be auto-verified. This parameter is required.
      Returns:
      this
    • deletionProtection

      @Stability(Stable) public CfnUserPool.Builder deletionProtection(String deletionProtection)
      When active, DeletionProtection prevents accidental deletion of your user pool.

      Before you can delete a user pool that you have protected against deletion, you must deactivate this feature.

      When you try to delete a protected user pool in a DeleteUserPool API request, Amazon Cognito returns an InvalidParameterException error. To delete a protected user pool, send a new DeleteUserPool request after you deactivate deletion protection in an UpdateUserPool API request.

      Parameters:
      deletionProtection - When active, DeletionProtection prevents accidental deletion of your user pool. This parameter is required.
      Returns:
      this
    • deviceConfiguration

      @Stability(Stable) public CfnUserPool.Builder deviceConfiguration(IResolvable deviceConfiguration)
      The device-remembering configuration for a user pool.

      A null value indicates that you have deactivated device remembering in your user pool.

      When you provide a value for any DeviceConfiguration field, you activate the Amazon Cognito device-remembering feature.

      Parameters:
      deviceConfiguration - The device-remembering configuration for a user pool. This parameter is required.
      Returns:
      this
    • deviceConfiguration

      @Stability(Stable) public CfnUserPool.Builder deviceConfiguration(CfnUserPool.DeviceConfigurationProperty deviceConfiguration)
      The device-remembering configuration for a user pool.

      A null value indicates that you have deactivated device remembering in your user pool.

      When you provide a value for any DeviceConfiguration field, you activate the Amazon Cognito device-remembering feature.

      Parameters:
      deviceConfiguration - The device-remembering configuration for a user pool. This parameter is required.
      Returns:
      this
    • emailConfiguration

      @Stability(Stable) public CfnUserPool.Builder emailConfiguration(IResolvable emailConfiguration)
      The email configuration of your user pool.

      The email configuration type sets your preferred sending method, AWS Region, and sender for messages from your user pool.

      Parameters:
      emailConfiguration - The email configuration of your user pool. This parameter is required.
      Returns:
      this
    • emailConfiguration

      @Stability(Stable) public CfnUserPool.Builder emailConfiguration(CfnUserPool.EmailConfigurationProperty emailConfiguration)
      The email configuration of your user pool.

      The email configuration type sets your preferred sending method, AWS Region, and sender for messages from your user pool.

      Parameters:
      emailConfiguration - The email configuration of your user pool. This parameter is required.
      Returns:
      this
    • emailVerificationMessage

      @Stability(Stable) public CfnUserPool.Builder emailVerificationMessage(String emailVerificationMessage)
      This parameter is no longer used.

      See VerificationMessageTemplateType .

      Parameters:
      emailVerificationMessage - This parameter is no longer used. This parameter is required.
      Returns:
      this
    • emailVerificationSubject

      @Stability(Stable) public CfnUserPool.Builder emailVerificationSubject(String emailVerificationSubject)
      This parameter is no longer used.

      See VerificationMessageTemplateType .

      Parameters:
      emailVerificationSubject - This parameter is no longer used. This parameter is required.
      Returns:
      this
    • enabledMfas

      @Stability(Stable) public CfnUserPool.Builder enabledMfas(List<String> enabledMfas)
      Enables MFA on a specified user pool.

      To disable all MFAs after it has been enabled, set MfaConfiguration to “OFF” and remove EnabledMfas. MFAs can only be all disabled if MfaConfiguration is OFF. Once SMS_MFA is enabled, SMS_MFA can only be disabled by setting MfaConfiguration to “OFF”. Can be one of the following values:

      • SMS_MFA - Enables SMS MFA for the user pool. SMS_MFA can only be enabled if SMS configuration is provided.
      • SOFTWARE_TOKEN_MFA - Enables software token MFA for the user pool.

      Allowed values: SMS_MFA | SOFTWARE_TOKEN_MFA

      Parameters:
      enabledMfas - Enables MFA on a specified user pool. This parameter is required.
      Returns:
      this
    • lambdaConfig

      @Stability(Stable) public CfnUserPool.Builder lambdaConfig(IResolvable lambdaConfig)
      The Lambda trigger configuration information for the new user pool.

      In a push model, event sources (such as Amazon S3 and custom applications) need permission to invoke a function. So you must make an extra call to add permission for these event sources to invoke your Lambda function.

      For more information on using the Lambda API to add permission, see AddPermission .

      For adding permission using the AWS CLI , see add-permission .

      Parameters:
      lambdaConfig - The Lambda trigger configuration information for the new user pool. This parameter is required.
      Returns:
      this
    • lambdaConfig

      @Stability(Stable) public CfnUserPool.Builder lambdaConfig(CfnUserPool.LambdaConfigProperty lambdaConfig)
      The Lambda trigger configuration information for the new user pool.

      In a push model, event sources (such as Amazon S3 and custom applications) need permission to invoke a function. So you must make an extra call to add permission for these event sources to invoke your Lambda function.

      For more information on using the Lambda API to add permission, see AddPermission .

      For adding permission using the AWS CLI , see add-permission .

      Parameters:
      lambdaConfig - The Lambda trigger configuration information for the new user pool. This parameter is required.
      Returns:
      this
    • mfaConfiguration

      @Stability(Stable) public CfnUserPool.Builder mfaConfiguration(String mfaConfiguration)
      The multi-factor authentication (MFA) configuration. Valid values include:.

      • OFF MFA won't be used for any users.
      • ON MFA is required for all users to sign in.
      • OPTIONAL MFA will be required only for individual users who have an MFA factor activated.

      Parameters:
      mfaConfiguration - The multi-factor authentication (MFA) configuration. Valid values include:. This parameter is required.
      Returns:
      this
    • policies

      @Stability(Stable) public CfnUserPool.Builder policies(IResolvable policies)
      The policy associated with a user pool.

      Parameters:
      policies - The policy associated with a user pool. This parameter is required.
      Returns:
      this
    • policies

      @Stability(Stable) public CfnUserPool.Builder policies(CfnUserPool.PoliciesProperty policies)
      The policy associated with a user pool.

      Parameters:
      policies - The policy associated with a user pool. This parameter is required.
      Returns:
      this
    • schema

      @Stability(Stable) public CfnUserPool.Builder schema(IResolvable schema)
      The schema attributes for the new user pool. These attributes can be standard or custom attributes.

      During a user pool update, you can add new schema attributes but you cannot modify or delete an existing schema attribute.

      Parameters:
      schema - The schema attributes for the new user pool. These attributes can be standard or custom attributes. This parameter is required.
      Returns:
      this
    • schema

      @Stability(Stable) public CfnUserPool.Builder schema(List<? extends Object> schema)
      The schema attributes for the new user pool. These attributes can be standard or custom attributes.

      During a user pool update, you can add new schema attributes but you cannot modify or delete an existing schema attribute.

      Parameters:
      schema - The schema attributes for the new user pool. These attributes can be standard or custom attributes. This parameter is required.
      Returns:
      this
    • smsAuthenticationMessage

      @Stability(Stable) public CfnUserPool.Builder smsAuthenticationMessage(String smsAuthenticationMessage)
      A string representing the SMS authentication message.

      Parameters:
      smsAuthenticationMessage - A string representing the SMS authentication message. This parameter is required.
      Returns:
      this
    • smsConfiguration

      @Stability(Stable) public CfnUserPool.Builder smsConfiguration(IResolvable smsConfiguration)
      The SMS configuration with the settings that your Amazon Cognito user pool must use to send an SMS message from your AWS account through Amazon Simple Notification Service.

      To send SMS messages with Amazon SNS in the AWS Region that you want, the Amazon Cognito user pool uses an AWS Identity and Access Management (IAM) role in your AWS account .

      Parameters:
      smsConfiguration - The SMS configuration with the settings that your Amazon Cognito user pool must use to send an SMS message from your AWS account through Amazon Simple Notification Service. This parameter is required.
      Returns:
      this
    • smsConfiguration

      @Stability(Stable) public CfnUserPool.Builder smsConfiguration(CfnUserPool.SmsConfigurationProperty smsConfiguration)
      The SMS configuration with the settings that your Amazon Cognito user pool must use to send an SMS message from your AWS account through Amazon Simple Notification Service.

      To send SMS messages with Amazon SNS in the AWS Region that you want, the Amazon Cognito user pool uses an AWS Identity and Access Management (IAM) role in your AWS account .

      Parameters:
      smsConfiguration - The SMS configuration with the settings that your Amazon Cognito user pool must use to send an SMS message from your AWS account through Amazon Simple Notification Service. This parameter is required.
      Returns:
      this
    • smsVerificationMessage

      @Stability(Stable) public CfnUserPool.Builder smsVerificationMessage(String smsVerificationMessage)
      This parameter is no longer used.

      See VerificationMessageTemplateType .

      Parameters:
      smsVerificationMessage - This parameter is no longer used. This parameter is required.
      Returns:
      this
    • userAttributeUpdateSettings

      @Stability(Stable) public CfnUserPool.Builder userAttributeUpdateSettings(IResolvable userAttributeUpdateSettings)
      The settings for updates to user attributes.

      These settings include the property AttributesRequireVerificationBeforeUpdate , a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers .

      Parameters:
      userAttributeUpdateSettings - The settings for updates to user attributes. This parameter is required.
      Returns:
      this
    • userAttributeUpdateSettings

      @Stability(Stable) public CfnUserPool.Builder userAttributeUpdateSettings(CfnUserPool.UserAttributeUpdateSettingsProperty userAttributeUpdateSettings)
      The settings for updates to user attributes.

      These settings include the property AttributesRequireVerificationBeforeUpdate , a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers .

      Parameters:
      userAttributeUpdateSettings - The settings for updates to user attributes. This parameter is required.
      Returns:
      this
    • usernameAttributes

      @Stability(Stable) public CfnUserPool.Builder usernameAttributes(List<String> usernameAttributes)
      Determines whether email addresses or phone numbers can be specified as user names when a user signs up.

      Possible values: phone_number or email .

      This user pool property cannot be updated.

      Parameters:
      usernameAttributes - Determines whether email addresses or phone numbers can be specified as user names when a user signs up. This parameter is required.
      Returns:
      this
    • usernameConfiguration

      @Stability(Stable) public CfnUserPool.Builder usernameConfiguration(IResolvable usernameConfiguration)
      You can choose to set case sensitivity on the username input for the selected sign-in option.

      For example, when this is set to False , users will be able to sign in using either "username" or "Username". This configuration is immutable once it has been set.

      Parameters:
      usernameConfiguration - You can choose to set case sensitivity on the username input for the selected sign-in option. This parameter is required.
      Returns:
      this
    • usernameConfiguration

      @Stability(Stable) public CfnUserPool.Builder usernameConfiguration(CfnUserPool.UsernameConfigurationProperty usernameConfiguration)
      You can choose to set case sensitivity on the username input for the selected sign-in option.

      For example, when this is set to False , users will be able to sign in using either "username" or "Username". This configuration is immutable once it has been set.

      Parameters:
      usernameConfiguration - You can choose to set case sensitivity on the username input for the selected sign-in option. This parameter is required.
      Returns:
      this
    • userPoolAddOns

      @Stability(Stable) public CfnUserPool.Builder userPoolAddOns(IResolvable userPoolAddOns)
      Enables advanced security risk detection.

      Set the key AdvancedSecurityMode to the value "AUDIT".

      Parameters:
      userPoolAddOns - Enables advanced security risk detection. This parameter is required.
      Returns:
      this
    • userPoolAddOns

      @Stability(Stable) public CfnUserPool.Builder userPoolAddOns(CfnUserPool.UserPoolAddOnsProperty userPoolAddOns)
      Enables advanced security risk detection.

      Set the key AdvancedSecurityMode to the value "AUDIT".

      Parameters:
      userPoolAddOns - Enables advanced security risk detection. This parameter is required.
      Returns:
      this
    • userPoolName

      @Stability(Stable) public CfnUserPool.Builder userPoolName(String userPoolName)
      A string used to name the user pool.

      Parameters:
      userPoolName - A string used to name the user pool. This parameter is required.
      Returns:
      this
    • userPoolTags

      @Stability(Stable) public CfnUserPool.Builder userPoolTags(Object userPoolTags)
      The tag keys and values to assign to the user pool.

      A tag is a label that you can use to categorize and manage user pools in different ways, such as by purpose, owner, environment, or other criteria.

      Parameters:
      userPoolTags - The tag keys and values to assign to the user pool. This parameter is required.
      Returns:
      this
    • verificationMessageTemplate

      @Stability(Stable) public CfnUserPool.Builder verificationMessageTemplate(IResolvable verificationMessageTemplate)
      The template for the verification message that the user sees when the app requests permission to access the user's information.

      Parameters:
      verificationMessageTemplate - The template for the verification message that the user sees when the app requests permission to access the user's information. This parameter is required.
      Returns:
      this
    • verificationMessageTemplate

      @Stability(Stable) public CfnUserPool.Builder verificationMessageTemplate(CfnUserPool.VerificationMessageTemplateProperty verificationMessageTemplate)
      The template for the verification message that the user sees when the app requests permission to access the user's information.

      Parameters:
      verificationMessageTemplate - The template for the verification message that the user sees when the app requests permission to access the user's information. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnUserPool build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnUserPool>
      Returns:
      a newly built instance of CfnUserPool.