How to allow only email as username alias with Clo

2019-06-23 16:36发布

问题:

Following this guide, it says:

On the Attributes tab, select Email address or phone number and select Allow email addresses.

Which looks like this:

But I'm having trouble accomplishing the same thing with CloudFormation. Tried a couple of the obvious attributes but did not work. Thoughts?

回答1:

It's now possible to do this by setting the UsernameAttributes property to an array of strings containing either email, phone_number or both:

Type: AWS::Cognito::UserPool
Properties:
  UsernameAttributes:
  - "email"
  UserPoolName: "test-pool"


回答2:

It seems that not possible using CFN. See this thread: https://forums.aws.amazon.com/thread.jspa?threadID=259349&tstart=0

Username attributes is a recently rolled out feature and it will be added in cloudformation templates soon.