AWS::Cognito::UserPool
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.
Note
If you don't specify a value for a parameter, Amazon Cognito sets it to a default value.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Cognito::UserPool", "Properties" : { "AccountRecoverySetting" :
AccountRecoverySetting
, "AdminCreateUserConfig" :AdminCreateUserConfig
, "AliasAttributes" :List
, "AutoVerifiedAttributes" :List
, "DeletionProtection" :String
, "DeviceConfiguration" :DeviceConfiguration
, "EmailConfiguration" :EmailConfiguration
, "EmailVerificationMessage" :String
, "EmailVerificationSubject" :String
, "EnabledMfas" :List
, "LambdaConfig" :LambdaConfig
, "MfaConfiguration" :String
, "Policies" :Policies
, "Schema" :List
, "SmsAuthenticationMessage" :String
, "SmsConfiguration" :SmsConfiguration
, "SmsVerificationMessage" :String
, "UserAttributeUpdateSettings" :UserAttributeUpdateSettings
, "UsernameAttributes" :List
, "UsernameConfiguration" :UsernameConfiguration
, "UserPoolAddOns" :UserPoolAddOns
, "UserPoolName" :String
, "UserPoolTags" :Map
, "VerificationMessageTemplate" :VerificationMessageTemplate
} }
YAML
Type: AWS::Cognito::UserPool Properties: AccountRecoverySetting:
AccountRecoverySetting
AdminCreateUserConfig:AdminCreateUserConfig
AliasAttributes:List
AutoVerifiedAttributes:List
DeletionProtection:String
DeviceConfiguration:DeviceConfiguration
EmailConfiguration:EmailConfiguration
EmailVerificationMessage:String
EmailVerificationSubject:String
EnabledMfas:List
LambdaConfig:LambdaConfig
MfaConfiguration:String
Policies:Policies
Schema:List
SmsAuthenticationMessage:String
SmsConfiguration:SmsConfiguration
SmsVerificationMessage:String
UserAttributeUpdateSettings:UserAttributeUpdateSettings
UsernameAttributes:List
UsernameConfiguration:UsernameConfiguration
UserPoolAddOns:UserPoolAddOns
UserPoolName:String
UserPoolTags:Map
VerificationMessageTemplate:VerificationMessageTemplate
Properties
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.Required: No
Type: AccountRecoverySetting
Update requires: No interruption
AdminCreateUserConfig
-
The configuration for creating a new user profile.
Required: No
Type: AdminCreateUserConfig
Update requires: No interruption
AliasAttributes
-
Attributes supported as an alias for this user pool. Possible values: phone_number, email, or preferred_username.
Note
This user pool property cannot be updated.
Required: No
Type: List of String
Update requires: No interruption
AutoVerifiedAttributes
-
The attributes to be auto-verified. Possible values: email, phone_number.
Required: No
Type: List of String
Update requires: No interruption
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 anInvalidParameterException
error. To delete a protected user pool, send a newDeleteUserPool
request after you deactivate deletion protection in anUpdateUserPool
API request.Required: No
Type: String
Allowed values:
ACTIVE | INACTIVE
Update requires: No interruption
DeviceConfiguration
-
The device-remembering configuration for a user pool. A null value indicates that you have deactivated device remembering in your user pool.
Note
When you provide a value for any
DeviceConfiguration
field, you activate the Amazon Cognito device-remembering feature.Required: No
Type: DeviceConfiguration
Update requires: No interruption
EmailConfiguration
-
The email configuration of your user pool. The email configuration type sets your preferred sending method, Amazon Region, and sender for messages from your user pool.
Required: No
Type: EmailConfiguration
Update requires: No interruption
EmailVerificationMessage
-
This parameter is no longer used. See VerificationMessageTemplateType.
Required: No
Type: String
Minimum:
6
Maximum:
20000
Pattern:
[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*\{####\}[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*
Update requires: No interruption
EmailVerificationSubject
-
This parameter is no longer used. See VerificationMessageTemplateType.
Required: No
Type: String
Minimum:
1
Maximum:
140
Pattern:
[\p{L}\p{M}\p{S}\p{N}\p{P}\s]+
Update requires: No interruption
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
Required: No
Type: List of String
Update requires: No interruption
-
LambdaConfig
-
The Lambda trigger configuration information for the new user pool.
Note
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 Amazon CLI, see add-permission .
Required: No
Type: LambdaConfig
Update requires: No interruption
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.
Required: No
Type: String
Allowed values:
OFF | ON | OPTIONAL
Update requires: No interruption
-
Policies
-
The policy associated with a user pool.
Required: No
Type: Policies
Update requires: No interruption
Schema
-
The schema attributes for the new user pool. These attributes can be standard or custom attributes.
Note
During a user pool update, you can add new schema attributes but you cannot modify or delete an existing schema attribute.
Required: No
Type: List of SchemaAttribute
Maximum:
50
Update requires: No interruption
SmsAuthenticationMessage
-
A string representing the SMS authentication message.
Required: No
Type: String
Minimum:
6
Maximum:
140
Pattern:
.*\{####\}.*
Update requires: No interruption
SmsConfiguration
-
The SMS configuration with the settings that your Amazon Cognito user pool must use to send an SMS message from your Amazon Web Services account through Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Region that you want, the Amazon Cognito user pool uses an Amazon Identity and Access Management (IAM) role in your Amazon Web Services account.
Required: No
Type: SmsConfiguration
Update requires: No interruption
SmsVerificationMessage
-
This parameter is no longer used. See VerificationMessageTemplateType.
Required: No
Type: String
Minimum:
6
Maximum:
140
Pattern:
.*\{####\}.*
Update requires: No interruption
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.Required: No
Type: UserAttributeUpdateSettings
Update requires: No interruption
UsernameAttributes
-
Determines whether email addresses or phone numbers can be specified as user names when a user signs up. Possible values:
phone_number
oremail
.This user pool property cannot be updated.
Required: No
Type: List of String
Update requires: No interruption
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.Required: No
Type: UsernameConfiguration
Update requires: No interruption
UserPoolAddOns
-
User pool add-ons. Contains settings for activation of advanced security features. To log user security information but take no action, set to
AUDIT
. To configure automatic security responses to risky traffic to your user pool, set toENFORCED
.For more information, see Adding advanced security to a user pool.
Required: No
Type: UserPoolAddOns
Update requires: No interruption
UserPoolName
-
A string used to name the user pool.
Required: No
Type: String
Minimum:
1
Maximum:
128
Pattern:
[\w\s+=,.@-]+
Update requires: No interruption
-
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.
Required: No
Type: Map of String
Update requires: No interruption
VerificationMessageTemplate
-
The template for the verification message that the user sees when the app requests permission to access the user's information.
Required: No
Type: VerificationMessageTemplate
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns a generated ID, such as
us-east-2_zgaEXAMPLE
.
For more information about using the Ref
function, see Ref
.
Fn::GetAtt
The Fn::GetAtt
intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt
intrinsic function, see Fn::GetAtt
.
Arn
-
The Amazon Resource Name (ARN) of the user pool, such as
arn:aws:cognito-idp:us-east-1:123412341234:userpool/us-east-1_123412341
. ProviderName
-
The provider name of the Amazon Cognito user pool, specified as a
String
. ProviderURL
-
The URL of the provider of the Amazon Cognito user pool, specified as a
String
. UserPoolId
Property description not available.