AWS::Cognito::UserPoolUser
The AWS::Cognito::UserPoolUser resource creates an Amazon Cognito user pool user.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Cognito::UserPoolUser", "Properties" : { "DesiredDeliveryMediums" : [String, ...], "ForceAliasCreation" :Boolean, "UserAttributes" : [AttributeType, ... ], "MessageAction" :String, "Username" :String, "UserPoolId" :String, "ValidationData" : [AttributeType, ...] } }
YAML
Type: AWS::Cognito::UserPoolUser Properties: DesiredDeliveryMediums: -StringForceAliasCreation:BooleanUserAttributes: -AttributeTypeMessageAction:StringUsername:StringUserPoolId:StringValidationData: -AttributeType
Properties
DesiredDeliveryMediums-
Specifies how the welcome message will be sent. For email, specify
EMAIL. To use a phone number, specifySMS. You can specify more than one value. The default value isSMS.Required: No
Type: List of String values
Update requires: Replacement
ForceAliasCreation-
Use this parameter only if the
phone_number_verifiedattribute or theemail_verifiedattribute is set toTrue. Otherwise, it is ignored. The default value isFalse.If this parameter is set to
Trueand the phone number or email address specified in theUserAttributesparameter already exists as an alias with a different user, the API call migrates the alias from the previous user to the newly created user. The previous user can no longer log in using that alias.If this parameter is set to
Falseand the alias already exists, the API throws anAliasExistsExceptionerror.Required: No
Type: Boolean
Update requires: Replacement
UserAttributes-
A list of name-value pairs that contain user attributes and attribute values to be set for the user that you are creating. You can create a user without specifying any attributes other than
Username. However, any attributes that you specify as required (inCreateUserPoolor in the Attributes tab of the console) must be supplied either by you (in your call toAdminCreateUser) or by the user (when signing up in response to your welcome message).Required: No
Type: List of Amazon Cognito UserPoolUser AttributeType
Update requires: Replacement
MessageAction-
Specifies the action you'd like to take for the message. Valid values are
RESENDandSUPPRESS.To resend the invitation message to a user that already exists and reset the expiration limit on the user's account, set this parameter to
RESEND. To suppress sending the message, set it toSUPPRESS. You can specify only one value.Required: No
Type: String
Update requires: Replacement
Username-
The user name for the user.
Usernamemust be unique within the user pool. It must be a UTF-8 string between 1 and 128 characters. You can't change the username.Required: No
Type: String
Update requires: Replacement
UserPoolId-
The ID for the user pool where the user will be created.
Required: Yes
Type: String
Update requires: Replacement
ValidationData-
The user's validation data. This is a list of name-value pairs that contain user attributes and attribute values that you can use for custom validation, such as restricting the types of user accounts that can be registered. For example, you might choose to allow or disallow user sign-up based on the user's domain.
To configure custom validation, you must create a Pre Sign-up Lambda trigger for the user pool. The Lambda trigger receives the validation data and uses it in the validation process. For more information, see Customizing User Pool Workflows by Using AWS Lambda Triggers in the Amazon Cognito Developer Guide.
Required: No
Type: List of Amazon Cognito UserPoolUser AttributeType
Update requires: Replacement
Return Value
Ref
When the logical ID of this resource is provided to the Ref
intrinsic function, Ref returns the name of the user. For example, admin.
For more information about using the Ref function, see Ref.
