Невозможно создать пользователя пула пользователей AWS Cognito

Я пытаюсь создать пользователя с помощью консоли пула пользователей Cognito (я устанавливаю значения для имени пользователя и временного пароля), но продолжаю получать эту ошибку.

Атрибуты не соответствуют схеме: дата рождения: номер не должен быть длиннее 10 символов (служба: AWSCognitoIdentityProviderService; код состояния: 400; код ошибки: InvalidParameterException; идентификатор запроса: 98f3de9e-5ce3-11e7-98e8-9d0c69d31df9)

Пул пользователей создается с использованием следующих безсерверных

Type: AWS::Cognito::UserPool
  DeletionPolicy: Retain
  Properties:
    UserPoolName: employees
    AdminCreateUserConfig:
      AllowAdminCreateUserOnly: true
    Policies:
      PasswordPolicy:
        MinimumLength: 8
        RequireLowercase: true
        RequireNumbers: true
    Schema:
      - Name: "picture"
        AttributeDataType: String
        Mutable: true
        Required: false
      - Name: "given_name"
        AttributeDataType: String
        Mutable: true
        Required: true
      - Name: "middle_name"
        AttributeDataType: String
        Mutable: true
        Required: false
      - Name: "family_name"
        AttributeDataType: String
        Mutable: true
        Required: true
      - Name: "address"
        AttributeDataType: String
        Mutable: true
        Required: false
      - Name: "birthdate"
        AttributeDataType: String
        Mutable: true
        Required: true
      - Name: "gender"
        AttributeDataType: String
        Mutable: true
        Required: true

person jasperagrante    schedule 29.06.2017    source источник


Ответы (1)


Должно быть уже довольно поздно, но попробуйте следующий код, я определил MinLength и MaxLength:

Type: AWS::Cognito::UserPool
  DeletionPolicy: Retain
  Properties:
    UserPoolName: employees
    AdminCreateUserConfig:
      AllowAdminCreateUserOnly: true
    Policies:
      PasswordPolicy:
        MinimumLength: 8
        RequireLowercase: true
        RequireNumbers: true
    Schema:
      - Name: "picture"
        AttributeDataType: String
        Mutable: true
        Required: false
      - Name: "given_name"
        AttributeDataType: String
        Mutable: true
        Required: true
      - Name: "middle_name"
        AttributeDataType: String
        Mutable: true
        Required: false
      - Name: "family_name"
        AttributeDataType: String
        Mutable: true
        Required: true
      - Name: "address"
        AttributeDataType: String
        Mutable: true
        Required: false
      - Name: "birthdate"
        AttributeDataType: String
        Mutable: true
        Required: true
        DeveloperOnlyAttribute: false
        StringAttributeConstraints: 
          MinLength: "10"
          MaxLength: "10"
      - Name: "gender"
        AttributeDataType: String
        Mutable: true
        Required: true
person Amir    schedule 11.04.2020