How to set verification attributes on AWS cognito with cloudformation?

Viewed 375

I'm trying to set the verification attributes on a cognito user pool with cloudformation and I've been going through the documentation back and forth for quite some time now and I cannot find the correct settings for this one.

To be more clear, this is what I'm trying to change: enter image description here

My current yaml file looks something like this:

UserPool:
Type: AWS::Cognito::UserPool
Properties:
  AdminCreateUserConfig:
    AllowAdminCreateUserOnly: false
  UserPoolName: !Sub ${AWS::StackName}-UserPool
  UsernameAttributes:
    - email
  AccountRecoverySetting:
    RecoveryMechanisms:
      - Name: verified_email
        Priority: 1
  VerificationMessageTemplate:
    DefaultEmailOption: CONFIRM_WITH_LINK
  Policies:
    PasswordPolicy:
      MinimumLength: 8
      RequireLowercase: true
      RequireNumbers: true
      RequireSymbols: true
      RequireUppercase: true
      TemporaryPasswordValidityDays: 7

Is there a way to do it in cloudformation?

1 Answers

Just set the AutoVerifiedAttributes attribute value as [] - an empty list

Example:

Resources:
  CUP1FD5E:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: SIMPLE
      UsernameAttributes:
        - email
      # empty list
      AutoVerifiedAttributes: []
Related