title: Cloudformation - Template attributes that allow users to use an email address or phone number as their “username” to sign up and sign in
body: <p>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.</p>
  
  <p>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.</p>
  
  <p><img src="https://i.stack.imgur.com/np7LE.gif" alt="cognito"></p>
  
  <p>I can define that through AWS Management Console (image above). Does anyone know how I can achieve that through Cloudformation template?</p>