[ aws . cognito-idp ]

update-user-pool

Description

Updates the specified user pool with the specified attributes. You can get a list of the current user pool settings using DescribeUserPool . If you don’t provide a value for an attribute, it will be set to the default value.

Note

This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom carriers require that you register an origination phone number before you can send SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint . Cognito will use the the registered number automatically. Otherwise, Cognito users that must receive SMS messages might be unable 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 SNS might place your account in SMS sandbox. In * sandbox mode * , you’ll have limitations, such as sending messages to only verified phone numbers. After testing in the sandbox environment, you can move out of the SMS sandbox and into production. For more information, see SMS message settings for Cognito User Pools in the Amazon Cognito Developer Guide .

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  update-user-pool
--user-pool-id <value>
[--policies <value>]
[--lambda-config <value>]
[--auto-verified-attributes <value>]
[--sms-verification-message <value>]
[--email-verification-message <value>]
[--email-verification-subject <value>]
[--verification-message-template <value>]
[--sms-authentication-message <value>]
[--mfa-configuration <value>]
[--device-configuration <value>]
[--email-configuration <value>]
[--sms-configuration <value>]
[--user-pool-tags <value>]
[--admin-create-user-config <value>]
[--user-pool-add-ons <value>]
[--account-recovery-setting <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]

Options

--user-pool-id (string)

The user pool ID for the user pool you want to update.

--policies (structure)

A container with the policies you wish to update in a user pool.

PasswordPolicy -> (structure)

The password policy.

MinimumLength -> (integer)

The minimum length of the password policy that you have set. Cannot be less than 6.

RequireUppercase -> (boolean)

In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.

RequireLowercase -> (boolean)

In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.

RequireNumbers -> (boolean)

In the password policy that you have set, refers to whether you have required users to use at least one number in their password.

RequireSymbols -> (boolean)

In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.

TemporaryPasswordValidityDays -> (integer)

In the password policy you have set, refers to the number of days a temporary password is valid. If the user does not sign-in during this time, their password will need to be reset by an administrator.

Note

When you set TemporaryPasswordValidityDays for a user pool, you will no longer be able to set the deprecated UnusedAccountValidityDays value for that user pool.

Shorthand Syntax:

PasswordPolicy={MinimumLength=integer,RequireUppercase=boolean,RequireLowercase=boolean,RequireNumbers=boolean,RequireSymbols=boolean,TemporaryPasswordValidityDays=integer}

JSON Syntax:

{
  "PasswordPolicy": {
    "MinimumLength": integer,
    "RequireUppercase": true|false,
    "RequireLowercase": true|false,
    "RequireNumbers": true|false,
    "RequireSymbols": true|false,
    "TemporaryPasswordValidityDays": integer
  }
}

--lambda-config (structure)

The Lambda configuration information from the request to update the user pool.

PreSignUp -> (string)

A pre-registration Lambda trigger.

CustomMessage -> (string)

A custom Message Lambda trigger.

PostConfirmation -> (string)

A post-confirmation Lambda trigger.

PreAuthentication -> (string)

A pre-authentication Lambda trigger.

PostAuthentication -> (string)

A post-authentication Lambda trigger.

DefineAuthChallenge -> (string)

Defines the authentication challenge.

CreateAuthChallenge -> (string)

Creates an authentication challenge.

VerifyAuthChallengeResponse -> (string)

Verifies the authentication challenge response.

PreTokenGeneration -> (string)

A Lambda trigger that is invoked before token generation.

UserMigration -> (string)

The user migration Lambda config type.

CustomSMSSender -> (structure)

A custom SMS sender Lambda trigger.

LambdaVersion -> (string)

The Lambda version represents the signature of the “request” attribute in the “event” information Amazon Cognito passes to your custom SMS Lambda function. The only supported value is V1_0 .

LambdaArn -> (string)

The Lambda Amazon Resource Name of the Lambda function that Amazon Cognito triggers to send SMS notifications to users.

CustomEmailSender -> (structure)

A custom email sender Lambda trigger.

LambdaVersion -> (string)

The Lambda version represents the signature of the “request” attribute in the “event” information Amazon Cognito passes to your custom email Lambda function. The only supported value is V1_0 .

LambdaArn -> (string)

The Lambda Amazon Resource Name of the Lambda function that Amazon Cognito triggers to send email notifications to users.

KMSKeyID -> (string)

The Amazon Resource Name of Key Management Service Customer master keys . Amazon Cognito uses the key to encrypt codes and temporary passwords sent to CustomEmailSender and CustomSMSSender .

Shorthand Syntax:

PreSignUp=string,CustomMessage=string,PostConfirmation=string,PreAuthentication=string,PostAuthentication=string,DefineAuthChallenge=string,CreateAuthChallenge=string,VerifyAuthChallengeResponse=string,PreTokenGeneration=string,UserMigration=string,CustomSMSSender={LambdaVersion=string,LambdaArn=string},CustomEmailSender={LambdaVersion=string,LambdaArn=string},KMSKeyID=string

JSON Syntax:

{
  "PreSignUp": "string",
  "CustomMessage": "string",
  "PostConfirmation": "string",
  "PreAuthentication": "string",
  "PostAuthentication": "string",
  "DefineAuthChallenge": "string",
  "CreateAuthChallenge": "string",
  "VerifyAuthChallengeResponse": "string",
  "PreTokenGeneration": "string",
  "UserMigration": "string",
  "CustomSMSSender": {
    "LambdaVersion": "V1_0",
    "LambdaArn": "string"
  },
  "CustomEmailSender": {
    "LambdaVersion": "V1_0",
    "LambdaArn": "string"
  },
  "KMSKeyID": "string"
}

--auto-verified-attributes (list)

The attributes that are automatically verified when the Amazon Cognito service makes a request to update user pools.

(string)

Syntax:

"string" "string" ...

Where valid values are:
  phone_number
  email

--sms-verification-message (string)

A container with information about the SMS verification message.

--email-verification-message (string)

The contents of the email verification message.

--email-verification-subject (string)

The subject of the email verification message.

--verification-message-template (structure)

The template for verification messages.

SmsMessage -> (string)

The SMS message template.

EmailMessage -> (string)

The email message template. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER.

EmailSubject -> (string)

The subject line for the email message template. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER.

EmailMessageByLink -> (string)

The email message template for sending a confirmation link to the user. EmailMessageByLink is allowed only if EmailSendingAccount is DEVELOPER.

EmailSubjectByLink -> (string)

The subject line for the email message template for sending a confirmation link to the user. EmailSubjectByLink is allowed only EmailSendingAccount is DEVELOPER.

DefaultEmailOption -> (string)

The default email option.

Shorthand Syntax:

SmsMessage=string,EmailMessage=string,EmailSubject=string,EmailMessageByLink=string,EmailSubjectByLink=string,DefaultEmailOption=string

JSON Syntax:

{
  "SmsMessage": "string",
  "EmailMessage": "string",
  "EmailSubject": "string",
  "EmailMessageByLink": "string",
  "EmailSubjectByLink": "string",
  "DefaultEmailOption": "CONFIRM_WITH_LINK"|"CONFIRM_WITH_CODE"
}

--sms-authentication-message (string)

The contents of the SMS authentication message.

--mfa-configuration (string)

Can be one of the following values:

  • OFF - MFA tokens are not required and cannot be specified during user registration.

  • ON - MFA tokens are required for all user registrations. You can only specify ON when you are initially creating a user pool. You can use the SetUserPoolMfaConfig API operation to turn MFA “ON” for existing user pools.

  • OPTIONAL - Users have the option when registering to create an MFA token.

Possible values:

  • OFF

  • ON

  • OPTIONAL

--device-configuration (structure)

Device configuration.

ChallengeRequiredOnNewDevice -> (boolean)

Indicates whether a challenge is required on a new device. Only applicable to a new device.

DeviceOnlyRememberedOnUserPrompt -> (boolean)

If true, a device is only remembered on user prompt.

Shorthand Syntax:

ChallengeRequiredOnNewDevice=boolean,DeviceOnlyRememberedOnUserPrompt=boolean

JSON Syntax:

{
  "ChallengeRequiredOnNewDevice": true|false,
  "DeviceOnlyRememberedOnUserPrompt": true|false
}

--email-configuration (structure)

Email configuration.

SourceArn -> (string)

The Amazon Resource Name (ARN) of a verified email address in Amazon SES. This email address is used in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:

  • If you specify COGNITO_DEFAULT , Amazon Cognito uses this address as the custom FROM address when it emails your users by using its built-in email account.

  • If you specify DEVELOPER , Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.

ReplyToEmailAddress -> (string)

The destination to which the receiver of the email should reply to.

EmailSendingAccount -> (string)

Specifies whether Amazon Cognito emails your users by using its built-in email functionality or your Amazon SES email configuration. Specify one of the following values:

COGNITO_DEFAULT

When Amazon Cognito emails your users, it uses its built-in email functionality. When you use the default option, Amazon Cognito allows only a limited number of emails each day for your user pool. For typical production environments, the default email limit is below the required delivery volume. To achieve a higher delivery volume, specify DEVELOPER to use your Amazon SES email configuration.

To look up the email delivery limit for the default option, see Limits in Amazon Cognito in the Amazon Cognito Developer Guide .

The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the ARN of an Amazon SES verified email address for the SourceArn parameter.

If EmailSendingAccount is COGNITO_DEFAULT, the following parameters aren’t allowed:

  • EmailVerificationMessage

  • EmailVerificationSubject

  • InviteMessageTemplate.EmailMessage

  • InviteMessageTemplate.EmailSubject

  • VerificationMessageTemplate.EmailMessage

  • VerificationMessageTemplate.EmailMessageByLink

  • VerificationMessageTemplate.EmailSubject,

  • VerificationMessageTemplate.EmailSubjectByLink

Note

DEVELOPER EmailSendingAccount is required.

DEVELOPER

When Amazon Cognito emails your users, it uses your Amazon SES configuration. Amazon Cognito calls Amazon SES on your behalf to send email from your verified email address. When you use this option, the email delivery limits are the same limits that apply to your Amazon SES verified email address in your account.

If you use this option, you must provide the ARN of an Amazon SES verified email address for the SourceArn parameter.

Before Amazon Cognito can email your users, it requires additional permissions to call Amazon SES on your behalf. When you update your user pool with this option, Amazon Cognito creates a service-linked role , which is a type of IAM role, in your account. This role contains the permissions that allow Amazon Cognito to access Amazon SES and send email messages with your address. For more information about the service-linked role that Amazon Cognito creates, see Using Service-Linked Roles for Amazon Cognito in the Amazon Cognito Developer Guide .

From -> (string)

Identifies either the sender’s email address or the sender’s name with their email address. For example, testuser@example.com or Test User <testuser@example.com> . This address will appear before the body of the email.

ConfigurationSet -> (string)

The set of configuration rules that can be applied to emails sent using Amazon SES. A configuration set is applied to an email by including a reference to the configuration set in the headers of the email. Once applied, all of the rules in that configuration set are applied to the email. Configuration sets can be used to apply the following types of rules to emails:

  • Event publishing – Amazon SES can track the number of send, delivery, open, click, bounce, and complaint events for each email sent. Use event publishing to send information about these events to other Amazon Web Services services such as SNS and CloudWatch.

  • IP pool management – When leasing dedicated IP addresses with Amazon SES, you can create groups of IP addresses, called dedicated IP pools. You can then associate the dedicated IP pools with configuration sets.

Shorthand Syntax:

SourceArn=string,ReplyToEmailAddress=string,EmailSendingAccount=string,From=string,ConfigurationSet=string

JSON Syntax:

{
  "SourceArn": "string",
  "ReplyToEmailAddress": "string",
  "EmailSendingAccount": "COGNITO_DEFAULT"|"DEVELOPER",
  "From": "string",
  "ConfigurationSet": "string"
}

--sms-configuration (structure)

SMS configuration.

SnsCallerArn -> (string)

The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller. This is the ARN of the IAM role in your account which Cognito will use to send SMS messages. SMS messages are subject to a spending limit .

ExternalId -> (string)

The external ID is a value that we recommend you use to add security to your IAM role which is used to call Amazon SNS to send SMS messages for your user pool. If you provide an ExternalId , the Cognito User Pool will include it when attempting to assume your IAM role, so that you can set your roles trust policy to require the ExternalID . If you use the Cognito Management Console to create a role for SMS MFA, Cognito will create a role with the required permissions and a trust policy that demonstrates use of the ExternalId .

For more information about the ExternalId of a role, see How to use an external ID when granting access to your Amazon Web Services resources to a third party

Shorthand Syntax:

SnsCallerArn=string,ExternalId=string

JSON Syntax:

{
  "SnsCallerArn": "string",
  "ExternalId": "string"
}

--user-pool-tags (map)

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.

key -> (string)

value -> (string)

Shorthand Syntax:

KeyName1=string,KeyName2=string

JSON Syntax:

{"string": "string"
  ...}

--admin-create-user-config (structure)

The configuration for AdminCreateUser requests.

AllowAdminCreateUserOnly -> (boolean)

Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

UnusedAccountValidityDays -> (integer)

The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this parameter is 7.

Note

If you set a value for TemporaryPasswordValidityDays in PasswordPolicy , that value will be used and UnusedAccountValidityDays will be deprecated for that user pool.

InviteMessageTemplate -> (structure)

The message template to be used for the welcome message to new users.

See also Customizing User Invitation Messages .

SMSMessage -> (string)

The message template for SMS messages.

EmailMessage -> (string)

The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER.

EmailSubject -> (string)

The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER.

Shorthand Syntax:

AllowAdminCreateUserOnly=boolean,UnusedAccountValidityDays=integer,InviteMessageTemplate={SMSMessage=string,EmailMessage=string,EmailSubject=string}

JSON Syntax:

{
  "AllowAdminCreateUserOnly": true|false,
  "UnusedAccountValidityDays": integer,
  "InviteMessageTemplate": {
    "SMSMessage": "string",
    "EmailMessage": "string",
    "EmailSubject": "string"
  }
}

--user-pool-add-ons (structure)

Used to enable advanced security risk detection. Set the key AdvancedSecurityMode to the value “AUDIT”.

AdvancedSecurityMode -> (string)

The advanced security mode.

Shorthand Syntax:

AdvancedSecurityMode=string

JSON Syntax:

{
  "AdvancedSecurityMode": "OFF"|"AUDIT"|"ENFORCED"
}

--account-recovery-setting (structure)

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.

RecoveryMechanisms -> (list)

The list of RecoveryOptionTypes .

(structure)

A map containing a priority as a key, and recovery method name as a value.

Priority -> (integer)

A positive integer specifying priority of a method with 1 being the highest priority.

Name -> (string)

Specifies the recovery method for a user.

Shorthand Syntax:

RecoveryMechanisms=[{Priority=integer,Name=string},{Priority=integer,Name=string}]

JSON Syntax:

{
  "RecoveryMechanisms": [
    {
      "Priority": integer,
      "Name": "verified_email"|"verified_phone_number"|"admin_only"
    }
    ...
  ]
}

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Examples

To update a user pool

This example adds tags to a user pool.

Command:

aws cognito-idp update-user-pool --user-pool-id us-west-2_aaaaaaaaa --user-pool-tags Team=Blue,Area=West

Output

None