Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Creates a new Amazon Cognito user pool and sets the password policy for the pool.
This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.
If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple Notification Service might place your account in the SMS sandbox. In <https:docs.aws.amazon.comsnslatestdgsns-sms-sandbox.html sandbox mode> , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.
Synopsis
- data CreateUserPool = CreateUserPool' {
- accountRecoverySetting :: Maybe AccountRecoverySettingType
- adminCreateUserConfig :: Maybe AdminCreateUserConfigType
- aliasAttributes :: Maybe [AliasAttributeType]
- autoVerifiedAttributes :: Maybe [VerifiedAttributeType]
- deletionProtection :: Maybe DeletionProtectionType
- deviceConfiguration :: Maybe DeviceConfigurationType
- emailConfiguration :: Maybe EmailConfigurationType
- emailVerificationMessage :: Maybe Text
- emailVerificationSubject :: Maybe Text
- lambdaConfig :: Maybe LambdaConfigType
- mfaConfiguration :: Maybe UserPoolMfaType
- policies :: Maybe UserPoolPolicyType
- schema :: Maybe (NonEmpty SchemaAttributeType)
- smsAuthenticationMessage :: Maybe Text
- smsConfiguration :: Maybe SmsConfigurationType
- smsVerificationMessage :: Maybe Text
- userAttributeUpdateSettings :: Maybe UserAttributeUpdateSettingsType
- userPoolAddOns :: Maybe UserPoolAddOnsType
- userPoolTags :: Maybe (HashMap Text Text)
- usernameAttributes :: Maybe [UsernameAttributeType]
- usernameConfiguration :: Maybe UsernameConfigurationType
- verificationMessageTemplate :: Maybe VerificationMessageTemplateType
- poolName :: Text
- newCreateUserPool :: Text -> CreateUserPool
- createUserPool_accountRecoverySetting :: Lens' CreateUserPool (Maybe AccountRecoverySettingType)
- createUserPool_adminCreateUserConfig :: Lens' CreateUserPool (Maybe AdminCreateUserConfigType)
- createUserPool_aliasAttributes :: Lens' CreateUserPool (Maybe [AliasAttributeType])
- createUserPool_autoVerifiedAttributes :: Lens' CreateUserPool (Maybe [VerifiedAttributeType])
- createUserPool_deletionProtection :: Lens' CreateUserPool (Maybe DeletionProtectionType)
- createUserPool_deviceConfiguration :: Lens' CreateUserPool (Maybe DeviceConfigurationType)
- createUserPool_emailConfiguration :: Lens' CreateUserPool (Maybe EmailConfigurationType)
- createUserPool_emailVerificationMessage :: Lens' CreateUserPool (Maybe Text)
- createUserPool_emailVerificationSubject :: Lens' CreateUserPool (Maybe Text)
- createUserPool_lambdaConfig :: Lens' CreateUserPool (Maybe LambdaConfigType)
- createUserPool_mfaConfiguration :: Lens' CreateUserPool (Maybe UserPoolMfaType)
- createUserPool_policies :: Lens' CreateUserPool (Maybe UserPoolPolicyType)
- createUserPool_schema :: Lens' CreateUserPool (Maybe (NonEmpty SchemaAttributeType))
- createUserPool_smsAuthenticationMessage :: Lens' CreateUserPool (Maybe Text)
- createUserPool_smsConfiguration :: Lens' CreateUserPool (Maybe SmsConfigurationType)
- createUserPool_smsVerificationMessage :: Lens' CreateUserPool (Maybe Text)
- createUserPool_userAttributeUpdateSettings :: Lens' CreateUserPool (Maybe UserAttributeUpdateSettingsType)
- createUserPool_userPoolAddOns :: Lens' CreateUserPool (Maybe UserPoolAddOnsType)
- createUserPool_userPoolTags :: Lens' CreateUserPool (Maybe (HashMap Text Text))
- createUserPool_usernameAttributes :: Lens' CreateUserPool (Maybe [UsernameAttributeType])
- createUserPool_usernameConfiguration :: Lens' CreateUserPool (Maybe UsernameConfigurationType)
- createUserPool_verificationMessageTemplate :: Lens' CreateUserPool (Maybe VerificationMessageTemplateType)
- createUserPool_poolName :: Lens' CreateUserPool Text
- data CreateUserPoolResponse = CreateUserPoolResponse' {}
- newCreateUserPoolResponse :: Int -> CreateUserPoolResponse
- createUserPoolResponse_userPool :: Lens' CreateUserPoolResponse (Maybe UserPoolType)
- createUserPoolResponse_httpStatus :: Lens' CreateUserPoolResponse Int
Creating a Request
data CreateUserPool Source #
Represents the request to create a user pool.
See: newCreateUserPool
smart constructor.
CreateUserPool' | |
|
Instances
Create a value of CreateUserPool
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
CreateUserPool
, createUserPool_accountRecoverySetting
- The available verified method a user can use to recover their password
when they call ForgotPassword
. You can use this setting to define a
preferred method when a user has more than one method available. With
this setting, SMS doesn't qualify for a valid password recovery
mechanism if the user also has SMS multi-factor authentication (MFA)
activated. In the absence of this setting, Amazon Cognito uses the
legacy behavior to determine the recovery method where SMS is preferred
through email.
CreateUserPool
, createUserPool_adminCreateUserConfig
- The configuration for AdminCreateUser
requests.
CreateUserPool
, createUserPool_aliasAttributes
- Attributes supported as an alias for this user pool. Possible values:
phone_number, email, or preferred_username.
CreateUserPool
, createUserPool_autoVerifiedAttributes
- The attributes to be auto-verified. Possible values: email,
phone_number.
CreateUserPool
, createUserPool_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.
CreateUserPool
, createUserPool_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.
CreateUserPool
, createUserPool_emailConfiguration
- The email configuration of your user pool. The email configuration type
sets your preferred sending method, Amazon Web Services Region, and
sender for messages from your user pool.
CreateUserPool
, createUserPool_emailVerificationMessage
- This parameter is no longer used. See
VerificationMessageTemplateType.
CreateUserPool
, createUserPool_emailVerificationSubject
- This parameter is no longer used. See
VerificationMessageTemplateType.
CreateUserPool
, createUserPool_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 CLI, see add-permission .
CreateUserPool
, createUserPool_mfaConfiguration
- Specifies MFA configuration details.
CreateUserPool
, createUserPool_policies
- The policies associated with the new user pool.
$sel:schema:CreateUserPool'
, createUserPool_schema
- An array of schema attributes for the new user pool. These attributes
can be standard or custom attributes.
CreateUserPool
, createUserPool_smsAuthenticationMessage
- A string representing the SMS authentication message.
CreateUserPool
, createUserPool_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 Web Services Region that you want, the
Amazon Cognito user pool uses an Identity and Access Management (IAM)
role in your Amazon Web Services account.
CreateUserPool
, createUserPool_smsVerificationMessage
- This parameter is no longer used. See
VerificationMessageTemplateType.
CreateUserPool
, createUserPool_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.
CreateUserPool
, createUserPool_userPoolAddOns
- Enables advanced security risk detection. Set the key
AdvancedSecurityMode
to the value "AUDIT".
CreateUserPool
, createUserPool_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.
CreateUserPool
, createUserPool_usernameAttributes
- Specifies whether a user can use an email address or phone number as a
username when they sign up.
CreateUserPool
, createUserPool_usernameConfiguration
- Case sensitivity on the username input for the selected sign-in option.
For example, when case sensitivity is set to False
, users can sign in
using either "username" or "Username". This configuration is
immutable once it has been set. For more information, see
UsernameConfigurationType.
CreateUserPool
, createUserPool_verificationMessageTemplate
- The template for the verification message that the user sees when the
app requests permission to access the user's information.
$sel:poolName:CreateUserPool'
, createUserPool_poolName
- A string used to name the user pool.
Request Lenses
createUserPool_accountRecoverySetting :: Lens' CreateUserPool (Maybe AccountRecoverySettingType) Source #
The available verified method a user can use to recover their password
when they call ForgotPassword
. You can use this setting to define a
preferred method when a user has more than one method available. With
this setting, SMS doesn't qualify for a valid password recovery
mechanism if the user also has SMS multi-factor authentication (MFA)
activated. In the absence of this setting, Amazon Cognito uses the
legacy behavior to determine the recovery method where SMS is preferred
through email.
createUserPool_adminCreateUserConfig :: Lens' CreateUserPool (Maybe AdminCreateUserConfigType) Source #
The configuration for AdminCreateUser
requests.
createUserPool_aliasAttributes :: Lens' CreateUserPool (Maybe [AliasAttributeType]) Source #
Attributes supported as an alias for this user pool. Possible values: phone_number, email, or preferred_username.
createUserPool_autoVerifiedAttributes :: Lens' CreateUserPool (Maybe [VerifiedAttributeType]) Source #
The attributes to be auto-verified. Possible values: email, phone_number.
createUserPool_deletionProtection :: Lens' CreateUserPool (Maybe DeletionProtectionType) Source #
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.
createUserPool_deviceConfiguration :: Lens' CreateUserPool (Maybe DeviceConfigurationType) Source #
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.
createUserPool_emailConfiguration :: Lens' CreateUserPool (Maybe EmailConfigurationType) Source #
The email configuration of your user pool. The email configuration type sets your preferred sending method, Amazon Web Services Region, and sender for messages from your user pool.
createUserPool_emailVerificationMessage :: Lens' CreateUserPool (Maybe Text) Source #
This parameter is no longer used. See VerificationMessageTemplateType.
createUserPool_emailVerificationSubject :: Lens' CreateUserPool (Maybe Text) Source #
This parameter is no longer used. See VerificationMessageTemplateType.
createUserPool_lambdaConfig :: Lens' CreateUserPool (Maybe LambdaConfigType) Source #
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 CLI, see add-permission .
createUserPool_mfaConfiguration :: Lens' CreateUserPool (Maybe UserPoolMfaType) Source #
Specifies MFA configuration details.
createUserPool_policies :: Lens' CreateUserPool (Maybe UserPoolPolicyType) Source #
The policies associated with the new user pool.
createUserPool_schema :: Lens' CreateUserPool (Maybe (NonEmpty SchemaAttributeType)) Source #
An array of schema attributes for the new user pool. These attributes can be standard or custom attributes.
createUserPool_smsAuthenticationMessage :: Lens' CreateUserPool (Maybe Text) Source #
A string representing the SMS authentication message.
createUserPool_smsConfiguration :: Lens' CreateUserPool (Maybe SmsConfigurationType) Source #
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 Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account.
createUserPool_smsVerificationMessage :: Lens' CreateUserPool (Maybe Text) Source #
This parameter is no longer used. See VerificationMessageTemplateType.
createUserPool_userAttributeUpdateSettings :: Lens' CreateUserPool (Maybe UserAttributeUpdateSettingsType) Source #
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.
createUserPool_userPoolAddOns :: Lens' CreateUserPool (Maybe UserPoolAddOnsType) Source #
Enables advanced security risk detection. Set the key
AdvancedSecurityMode
to the value "AUDIT".
createUserPool_userPoolTags :: Lens' CreateUserPool (Maybe (HashMap Text Text)) Source #
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.
createUserPool_usernameAttributes :: Lens' CreateUserPool (Maybe [UsernameAttributeType]) Source #
Specifies whether a user can use an email address or phone number as a username when they sign up.
createUserPool_usernameConfiguration :: Lens' CreateUserPool (Maybe UsernameConfigurationType) Source #
Case sensitivity on the username input for the selected sign-in option.
For example, when case sensitivity is set to False
, users can sign in
using either "username" or "Username". This configuration is
immutable once it has been set. For more information, see
UsernameConfigurationType.
createUserPool_verificationMessageTemplate :: Lens' CreateUserPool (Maybe VerificationMessageTemplateType) Source #
The template for the verification message that the user sees when the app requests permission to access the user's information.
createUserPool_poolName :: Lens' CreateUserPool Text Source #
A string used to name the user pool.
Destructuring the Response
data CreateUserPoolResponse Source #
Represents the response from the server for the request to create a user pool.
See: newCreateUserPoolResponse
smart constructor.
CreateUserPoolResponse' | |
|
Instances
newCreateUserPoolResponse Source #
Create a value of CreateUserPoolResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:userPool:CreateUserPoolResponse'
, createUserPoolResponse_userPool
- A container for the user pool details.
$sel:httpStatus:CreateUserPoolResponse'
, createUserPoolResponse_httpStatus
- The response's http status code.
Response Lenses
createUserPoolResponse_userPool :: Lens' CreateUserPoolResponse (Maybe UserPoolType) Source #
A container for the user pool details.
createUserPoolResponse_httpStatus :: Lens' CreateUserPoolResponse Int Source #
The response's http status code.