问题
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.
来源:https://stackoverflow.com/questions/47777541/how-to-allow-only-email-as-username-alias-with-cloudformation