@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:05.002Z") @Stability(value=Stable) public class CfnUserPool extends CfnResource implements IInspectable
The AWS::Cognito::UserPool resource creates an Amazon Cognito user pool. For more information on working with Amazon Cognito user pools, see Amazon Cognito User Pools and CreateUserPool .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cognito.*;
Object userPoolTags;
CfnUserPool cfnUserPool = CfnUserPool.Builder.create(this, "MyCfnUserPool")
.accountRecoverySetting(AccountRecoverySettingProperty.builder()
.recoveryMechanisms(List.of(RecoveryOptionProperty.builder()
.name("name")
.priority(123)
.build()))
.build())
.adminCreateUserConfig(AdminCreateUserConfigProperty.builder()
.allowAdminCreateUserOnly(false)
.inviteMessageTemplate(InviteMessageTemplateProperty.builder()
.emailMessage("emailMessage")
.emailSubject("emailSubject")
.smsMessage("smsMessage")
.build())
.unusedAccountValidityDays(123)
.build())
.aliasAttributes(List.of("aliasAttributes"))
.autoVerifiedAttributes(List.of("autoVerifiedAttributes"))
.deviceConfiguration(DeviceConfigurationProperty.builder()
.challengeRequiredOnNewDevice(false)
.deviceOnlyRememberedOnUserPrompt(false)
.build())
.emailConfiguration(EmailConfigurationProperty.builder()
.configurationSet("configurationSet")
.emailSendingAccount("emailSendingAccount")
.from("from")
.replyToEmailAddress("replyToEmailAddress")
.sourceArn("sourceArn")
.build())
.emailVerificationMessage("emailVerificationMessage")
.emailVerificationSubject("emailVerificationSubject")
.enabledMfas(List.of("enabledMfas"))
.lambdaConfig(LambdaConfigProperty.builder()
.createAuthChallenge("createAuthChallenge")
.customEmailSender(CustomEmailSenderProperty.builder()
.lambdaArn("lambdaArn")
.lambdaVersion("lambdaVersion")
.build())
.customMessage("customMessage")
.customSmsSender(CustomSMSSenderProperty.builder()
.lambdaArn("lambdaArn")
.lambdaVersion("lambdaVersion")
.build())
.defineAuthChallenge("defineAuthChallenge")
.kmsKeyId("kmsKeyId")
.postAuthentication("postAuthentication")
.postConfirmation("postConfirmation")
.preAuthentication("preAuthentication")
.preSignUp("preSignUp")
.preTokenGeneration("preTokenGeneration")
.userMigration("userMigration")
.verifyAuthChallengeResponse("verifyAuthChallengeResponse")
.build())
.mfaConfiguration("mfaConfiguration")
.policies(PoliciesProperty.builder()
.passwordPolicy(PasswordPolicyProperty.builder()
.minimumLength(123)
.requireLowercase(false)
.requireNumbers(false)
.requireSymbols(false)
.requireUppercase(false)
.temporaryPasswordValidityDays(123)
.build())
.build())
.schema(List.of(SchemaAttributeProperty.builder()
.attributeDataType("attributeDataType")
.developerOnlyAttribute(false)
.mutable(false)
.name("name")
.numberAttributeConstraints(NumberAttributeConstraintsProperty.builder()
.maxValue("maxValue")
.minValue("minValue")
.build())
.required(false)
.stringAttributeConstraints(StringAttributeConstraintsProperty.builder()
.maxLength("maxLength")
.minLength("minLength")
.build())
.build()))
.smsAuthenticationMessage("smsAuthenticationMessage")
.smsConfiguration(SmsConfigurationProperty.builder()
.externalId("externalId")
.snsCallerArn("snsCallerArn")
.build())
.smsVerificationMessage("smsVerificationMessage")
.usernameAttributes(List.of("usernameAttributes"))
.usernameConfiguration(UsernameConfigurationProperty.builder()
.caseSensitive(false)
.build())
.userPoolAddOns(UserPoolAddOnsProperty.builder()
.advancedSecurityMode("advancedSecurityMode")
.build())
.userPoolName("userPoolName")
.userPoolTags(userPoolTags)
.verificationMessageTemplate(VerificationMessageTemplateProperty.builder()
.defaultEmailOption("defaultEmailOption")
.emailMessage("emailMessage")
.emailMessageByLink("emailMessageByLink")
.emailSubject("emailSubject")
.emailSubjectByLink("emailSubjectByLink")
.smsMessage("smsMessage")
.build())
.build();
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnUserPool.AccountRecoverySettingProperty
Use this setting to define which verified available method a user can use to recover their password when they call `ForgotPassword` .
|
static interface |
CfnUserPool.AdminCreateUserConfigProperty
The configuration for `AdminCreateUser` requests.
|
static class |
CfnUserPool.Builder
A fluent builder for
CfnUserPool. |
static interface |
CfnUserPool.CustomEmailSenderProperty
Example:
|
static interface |
CfnUserPool.CustomSMSSenderProperty
Example:
|
static interface |
CfnUserPool.DeviceConfigurationProperty
The configuration for the user pool's device tracking.
|
static interface |
CfnUserPool.EmailConfigurationProperty
The email configuration.
|
static interface |
CfnUserPool.InviteMessageTemplateProperty
The message template to be used for the welcome message to new users.
|
static interface |
CfnUserPool.LambdaConfigProperty
Specifies the configuration for AWS Lambda triggers.
|
static interface |
CfnUserPool.NumberAttributeConstraintsProperty
The minimum and maximum value of an attribute that is of the number data type.
|
static interface |
CfnUserPool.PasswordPolicyProperty
The password policy type.
|
static interface |
CfnUserPool.PoliciesProperty
The policy associated with a user pool.
|
static interface |
CfnUserPool.RecoveryOptionProperty
A map containing a priority as a key, and recovery method name as a value.
|
static interface |
CfnUserPool.SchemaAttributeProperty
Contains information about the schema attribute.
|
static interface |
CfnUserPool.SmsConfigurationProperty
The SMS configuration type that includes the settings the Cognito User Pool needs to call for the Amazon SNS service to send an SMS message from your AWS account .
|
static interface |
CfnUserPool.StringAttributeConstraintsProperty
The `StringAttributeConstraints` property type defines the string attribute constraints of an Amazon Cognito user pool.
|
static interface |
CfnUserPool.UsernameConfigurationProperty
The `UsernameConfiguration` property type specifies case sensitivity on the username input for the selected sign-in option.
|
static interface |
CfnUserPool.UserPoolAddOnsProperty
The user pool add-ons type.
|
static interface |
CfnUserPool.VerificationMessageTemplateProperty
The template for verification messages.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$ProxyIConstruct.Jsii$Default| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnUserPool(Construct scope,
String id)
Create a new `AWS::Cognito::UserPool`.
|
|
CfnUserPool(Construct scope,
String id,
CfnUserPoolProps props)
Create a new `AWS::Cognito::UserPool`.
|
protected |
CfnUserPool(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnUserPool(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAccountRecoverySetting()
Use this setting to define which verified available method a user can use to recover their password when they call `ForgotPassword` .
|
Object |
getAdminCreateUserConfig()
The configuration for creating a new user profile.
|
List<String> |
getAliasAttributes()
Attributes supported as an alias for this user pool.
|
String |
getAttrArn()
The Amazon Resource Name (ARN) of the user pool, such as `arn:aws:cognito-idp:us-east-1:123412341234:userpool/us-east-1_123412341` .
|
String |
getAttrProviderName()
The provider name of the Amazon Cognito user pool, specified as a `String` .
|
String |
getAttrProviderUrl()
The URL of the provider of the Amazon Cognito user pool, specified as a `String` .
|
List<String> |
getAutoVerifiedAttributes()
The attributes to be auto-verified.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getDeviceConfiguration()
The device configuration.
|
Object |
getEmailConfiguration()
The email configuration.
|
String |
getEmailVerificationMessage()
A string representing the email verification message.
|
String |
getEmailVerificationSubject()
A string representing the email verification subject.
|
List<String> |
getEnabledMfas()
Enables MFA on a specified user pool.
|
Object |
getLambdaConfig()
The Lambda trigger configuration information for the new user pool.
|
String |
getMfaConfiguration()
The multi-factor (MFA) configuration.
|
Object |
getPolicies()
The policy associated with a user pool.
|
Object |
getSchema()
The schema attributes for the new user pool.
|
String |
getSmsAuthenticationMessage()
A string representing the SMS authentication message.
|
Object |
getSmsConfiguration()
The SMS configuration.
|
String |
getSmsVerificationMessage()
A string representing the SMS verification message.
|
TagManager |
getTags()
The tag keys and values to assign to the user pool.
|
List<String> |
getUsernameAttributes()
Determines whether email addresses or phone numbers can be specified as user names when a user signs up.
|
Object |
getUsernameConfiguration()
You can choose to set case sensitivity on the username input for the selected sign-in option.
|
Object |
getUserPoolAddOns()
Used to enable advanced security risk detection.
|
String |
getUserPoolName()
A string used to name the user pool.
|
Object |
getVerificationMessageTemplate()
The template for the verification message that the user sees when the app requests permission to access the user's information.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAccountRecoverySetting(CfnUserPool.AccountRecoverySettingProperty value)
Use this setting to define which verified available method a user can use to recover their password when they call `ForgotPassword` .
|
void |
setAccountRecoverySetting(IResolvable value)
Use this setting to define which verified available method a user can use to recover their password when they call `ForgotPassword` .
|
void |
setAdminCreateUserConfig(CfnUserPool.AdminCreateUserConfigProperty value)
The configuration for creating a new user profile.
|
void |
setAdminCreateUserConfig(IResolvable value)
The configuration for creating a new user profile.
|
void |
setAliasAttributes(List<String> value)
Attributes supported as an alias for this user pool.
|
void |
setAutoVerifiedAttributes(List<String> value)
The attributes to be auto-verified.
|
void |
setDeviceConfiguration(CfnUserPool.DeviceConfigurationProperty value)
The device configuration.
|
void |
setDeviceConfiguration(IResolvable value)
The device configuration.
|
void |
setEmailConfiguration(CfnUserPool.EmailConfigurationProperty value)
The email configuration.
|
void |
setEmailConfiguration(IResolvable value)
The email configuration.
|
void |
setEmailVerificationMessage(String value)
A string representing the email verification message.
|
void |
setEmailVerificationSubject(String value)
A string representing the email verification subject.
|
void |
setEnabledMfas(List<String> value)
Enables MFA on a specified user pool.
|
void |
setLambdaConfig(CfnUserPool.LambdaConfigProperty value)
The Lambda trigger configuration information for the new user pool.
|
void |
setLambdaConfig(IResolvable value)
The Lambda trigger configuration information for the new user pool.
|
void |
setMfaConfiguration(String value)
The multi-factor (MFA) configuration.
|
void |
setPolicies(CfnUserPool.PoliciesProperty value)
The policy associated with a user pool.
|
void |
setPolicies(IResolvable value)
The policy associated with a user pool.
|
void |
setSchema(IResolvable value)
The schema attributes for the new user pool.
|
void |
setSchema(List<Object> value)
The schema attributes for the new user pool.
|
void |
setSmsAuthenticationMessage(String value)
A string representing the SMS authentication message.
|
void |
setSmsConfiguration(CfnUserPool.SmsConfigurationProperty value)
The SMS configuration.
|
void |
setSmsConfiguration(IResolvable value)
The SMS configuration.
|
void |
setSmsVerificationMessage(String value)
A string representing the SMS verification message.
|
void |
setUsernameAttributes(List<String> value)
Determines whether email addresses or phone numbers can be specified as user names when a user signs up.
|
void |
setUsernameConfiguration(CfnUserPool.UsernameConfigurationProperty value)
You can choose to set case sensitivity on the username input for the selected sign-in option.
|
void |
setUsernameConfiguration(IResolvable value)
You can choose to set case sensitivity on the username input for the selected sign-in option.
|
void |
setUserPoolAddOns(CfnUserPool.UserPoolAddOnsProperty value)
Used to enable advanced security risk detection.
|
void |
setUserPoolAddOns(IResolvable value)
Used to enable advanced security risk detection.
|
void |
setUserPoolName(String value)
A string used to name the user pool.
|
void |
setVerificationMessageTemplate(CfnUserPool.VerificationMessageTemplateProperty value)
The template for the verification message that the user sees when the app requests permission to access the user's information.
|
void |
setVerificationMessageTemplate(IResolvable value)
The template for the verification message that the user sees when the app requests permission to access the user's information.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnUserPool(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnUserPool(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnUserPool(@NotNull
Construct scope,
@NotNull
String id,
@Nullable
CfnUserPoolProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
@Stability(value=Stable) @NotNull public String getAttrProviderName()
@Stability(value=Stable) @NotNull public String getAttrProviderUrl()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
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.
@Stability(value=Stable) @Nullable public Object getAccountRecoverySetting()
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.
@Stability(value=Stable)
public void setAccountRecoverySetting(@Nullable
CfnUserPool.AccountRecoverySettingProperty value)
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.
@Stability(value=Stable)
public void setAccountRecoverySetting(@Nullable
IResolvable value)
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.
@Stability(value=Stable) @Nullable public Object getAdminCreateUserConfig()
@Stability(value=Stable)
public void setAdminCreateUserConfig(@Nullable
CfnUserPool.AdminCreateUserConfigProperty value)
@Stability(value=Stable)
public void setAdminCreateUserConfig(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public List<String> getAliasAttributes()
This user pool property cannot be updated.
@Stability(value=Stable)
public void setAliasAttributes(@Nullable
List<String> value)
This user pool property cannot be updated.
@Stability(value=Stable) @Nullable public List<String> getAutoVerifiedAttributes()
Possible values: email , phone_number .
@Stability(value=Stable)
public void setAutoVerifiedAttributes(@Nullable
List<String> value)
Possible values: email , phone_number .
@Stability(value=Stable) @Nullable public Object getDeviceConfiguration()
@Stability(value=Stable)
public void setDeviceConfiguration(@Nullable
CfnUserPool.DeviceConfigurationProperty value)
@Stability(value=Stable)
public void setDeviceConfiguration(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getEmailConfiguration()
@Stability(value=Stable)
public void setEmailConfiguration(@Nullable
CfnUserPool.EmailConfigurationProperty value)
@Stability(value=Stable)
public void setEmailConfiguration(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getEmailVerificationMessage()
EmailVerificationMessage is allowed only if EmailSendingAccount is DEVELOPER.
@Stability(value=Stable)
public void setEmailVerificationMessage(@Nullable
String value)
EmailVerificationMessage is allowed only if EmailSendingAccount is DEVELOPER.
@Stability(value=Stable) @Nullable public String getEmailVerificationSubject()
EmailVerificationSubject is allowed only if EmailSendingAccount is DEVELOPER.
@Stability(value=Stable)
public void setEmailVerificationSubject(@Nullable
String value)
EmailVerificationSubject is allowed only if EmailSendingAccount is DEVELOPER.
@Stability(value=Stable) @Nullable public List<String> getEnabledMfas()
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
@Stability(value=Stable)
public void setEnabledMfas(@Nullable
List<String> value)
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
@Stability(value=Stable) @Nullable public Object getLambdaConfig()
In a push model, event sources (such as Amazon S3 and custom applications) need permission to invoke a function. So you will need to 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 .
@Stability(value=Stable)
public void setLambdaConfig(@Nullable
CfnUserPool.LambdaConfigProperty value)
In a push model, event sources (such as Amazon S3 and custom applications) need permission to invoke a function. So you will need to 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 .
@Stability(value=Stable)
public void setLambdaConfig(@Nullable
IResolvable value)
In a push model, event sources (such as Amazon S3 and custom applications) need permission to invoke a function. So you will need to 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 .
@Stability(value=Stable) @Nullable public String getMfaConfiguration()
OFF MFA will not 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 enabled.@Stability(value=Stable)
public void setMfaConfiguration(@Nullable
String value)
OFF MFA will not 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 enabled.@Stability(value=Stable) @Nullable public Object getPolicies()
@Stability(value=Stable)
public void setPolicies(@Nullable
CfnUserPool.PoliciesProperty value)
@Stability(value=Stable)
public void setPolicies(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getSchema()
During a user pool update, you can add new schema attributes but you cannot modify or delete an existing schema attribute.
@Stability(value=Stable)
public void setSchema(@Nullable
IResolvable value)
During a user pool update, you can add new schema attributes but you cannot modify or delete an existing schema attribute.
@Stability(value=Stable)
public void setSchema(@Nullable
List<Object> value)
During a user pool update, you can add new schema attributes but you cannot modify or delete an existing schema attribute.
@Stability(value=Stable) @Nullable public String getSmsAuthenticationMessage()
@Stability(value=Stable)
public void setSmsAuthenticationMessage(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getSmsConfiguration()
@Stability(value=Stable)
public void setSmsConfiguration(@Nullable
CfnUserPool.SmsConfigurationProperty value)
@Stability(value=Stable)
public void setSmsConfiguration(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getSmsVerificationMessage()
@Stability(value=Stable)
public void setSmsVerificationMessage(@Nullable
String value)
@Stability(value=Stable) @Nullable public List<String> getUsernameAttributes()
Possible values: phone_number or email .
This user pool property cannot be updated.
@Stability(value=Stable)
public void setUsernameAttributes(@Nullable
List<String> value)
Possible values: phone_number or email .
This user pool property cannot be updated.
@Stability(value=Stable) @Nullable public Object getUsernameConfiguration()
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.
@Stability(value=Stable)
public void setUsernameConfiguration(@Nullable
CfnUserPool.UsernameConfigurationProperty value)
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.
@Stability(value=Stable)
public void setUsernameConfiguration(@Nullable
IResolvable value)
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.
@Stability(value=Stable) @Nullable public Object getUserPoolAddOns()
Set the key AdvancedSecurityMode to the value "AUDIT".
@Stability(value=Stable)
public void setUserPoolAddOns(@Nullable
CfnUserPool.UserPoolAddOnsProperty value)
Set the key AdvancedSecurityMode to the value "AUDIT".
@Stability(value=Stable)
public void setUserPoolAddOns(@Nullable
IResolvable value)
Set the key AdvancedSecurityMode to the value "AUDIT".
@Stability(value=Stable) @Nullable public String getUserPoolName()
@Stability(value=Stable)
public void setUserPoolName(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getVerificationMessageTemplate()
@Stability(value=Stable)
public void setVerificationMessageTemplate(@Nullable
CfnUserPool.VerificationMessageTemplateProperty value)
@Stability(value=Stable)
public void setVerificationMessageTemplate(@Nullable
IResolvable value)
Copyright © 2022. All rights reserved.