Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow only email as username alias with CloudFormation?

Following this guide, it says:

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

Which looks like this:

enter image description here

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

like image 686
Daniel Birowsky Popeski Avatar asked Dec 12 '17 16:12

Daniel Birowsky Popeski


2 Answers

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.

like image 24
Yogesh_D Avatar answered Oct 24 '22 03:10

Yogesh_D


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"
like image 147
0x6C38 Avatar answered Oct 24 '22 04:10

0x6C38