Cloudformation - Template attributes that allow users to use an email address or phone number as their “username” to sign up and sign in

Viewed 609

I'm trying to create a Cognito User Pool through Cloudformation but I'm unable to define a template that allow users to use an email address or phone number as their “username” to sign up and sign in to my application.

I have created an AWS::Cognito::UserPool setting phone_number and email as AliasAttributes, but when I try to sign up with an email or phone number as username I get a message telling that the username cannot match an email or phone number format.

cognito

I can define that through AWS Management Console (image above). Does anyone know how I can achieve that through Cloudformation template?

2 Answers

I'm from the future!

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

Found it here

Thought I'd post it here for posterity.

Related