AWS Cognito - How do I create a pool that allows me to register with an email address using CloudFormation?

I am trying to create a UserPool using CloudFormation syntax but cannot find which property I need to set in order to create a pool with the email address registered. How do I indicate this?

enter image description here

As you can see in the screenshot, by default the pool is created with usernames.

Here is my current pool configuration;

MyPool:
  Type: "AWS::Cognito::UserPool"
  Properties:
    Schema:
      - Name: sub
        StringAttributeConstraints:
          MinLength: '1'
          MaxLength: '2048'
        DeveloperOnlyAttribute: false
        Required: true
        AttributeDataType: String
        Mutable: false
      - Name: name
        StringAttributeConstraints:
          MinLength: '0'
          MaxLength: '2048'
        DeveloperOnlyAttribute: false
        Required: false
        AttributeDataType: String
        Mutable: true
      - Name: updated_at
        NumberAttributeConstraints:
          MinValue: '0'
        DeveloperOnlyAttribute: false
        Required: false
        AttributeDataType: Number
        Mutable: true
    UserPoolName: ${self:provider.environment.PARTNER_POOL}
    EmailVerificationMessage: 'Please click the link below to verify your email address.
        {####} '
    EmailVerificationSubject: Your verification link
    SmsAuthenticationMessage: 'Your authentication code is {####}. '
    DeviceConfiguration:
      ChallengeRequiredOnNewDevice: false
      DeviceOnlyRememberedOnUserPrompt: false
    AdminCreateUserConfig:
      InviteMessageTemplate:
        EmailMessage: 'Your username is {username} and temporary password is {####}. '
        EmailSubject: Your temporary password
        SMSMessage: 'Your username is {username} and temporary password is {####}. '
      UnusedAccountValidityDays: 7
      AllowAdminCreateUserOnly: false
    EmailConfiguration: {}
    AutoVerifiedAttributes:
      - email
    Policies:
      PasswordPolicy:
        RequireLowercase: false
        RequireSymbols: false
        RequireNumbers: true
        MinimumLength: 8
        RequireUppercase: false
    AliasAttributes:
      - email
+5
source share
3 answers

SignUp CloudFormation. , , UsernameAttributes.

+1 , CloudFormation.

+7

CloudFormation.

AWS :: Cognito :: UserPool → UsernameAttributes ,

    UserPool:
        Type: AWS::Cognito::UserPool
        Properties:
            UsernameAttributes: 
                - email
0

You need to install AliasAttributes.

AWS :: Cognito :: UserPool → AliasAttributes

Here is a sample CloudFormation template:

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  UserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      AliasAttributes:
        - email
      UserPoolName:
        Ref: AWS::StackName
-1
source

Source: https://habr.com/ru/post/1687071/


All Articles