我正在尝试使用 CloudFormation 语法创建 UserPool,但我无法找到需要设置哪个属性才能使用电子邮件地址注册创建池。我该如何指定这一点?
正如您在屏幕截图中看到的,默认情况下,池是使用用户名创建的。
这是我当前的池配置;
MyPool:
Type: "AWS::Cognito::UserPool"
Properties:
Schema:
- Name: sub
StringAttributeConstraints:
MinLength: '1'
MaxLength: '2048'
DeveloperOnlyAttribute: false
Required: true
AttributeDataType: String
Mutable: false
- Name: name
StringAttributeConstraints:
MinLength: '0'
MaxLength: '2048'
DeveloperOnlyAttribute: false
Required: false
AttributeDataType: String
Mutable: true
- Name: updated_at
NumberAttributeConstraints:
MinValue: '0'
DeveloperOnlyAttribute: false
Required: false
AttributeDataType: Number
Mutable: true
UserPoolName: ${self:provider.environment.PARTNER_POOL}
EmailVerificationMessage: 'Please click the link below to verify your email address.
{####} '
EmailVerificationSubject: Your verification link
SmsAuthenticationMessage: 'Your authentication code is {####}. '
DeviceConfiguration:
ChallengeRequiredOnNewDevice: false
DeviceOnlyRememberedOnUserPrompt: false
AdminCreateUserConfig:
InviteMessageTemplate:
EmailMessage: 'Your username is {username} and temporary password is {####}. '
EmailSubject: Your temporary password
SMSMessage: 'Your username is {username} and temporary password is {####}. '
UnusedAccountValidityDays: 7
AllowAdminCreateUserOnly: false
EmailConfiguration: {}
AutoVerifiedAttributes:
- email
Policies:
PasswordPolicy:
RequireLowercase: false
RequireSymbols: false
RequireNumbers: true
MinimumLength: 8
RequireUppercase: false
AliasAttributes:
- email
最佳答案
CloudFormation 尚不支持使用新的注册流程选项配置用户池的功能。用于指定仅电子邮件或电话号码选项的参数是 UsernameAttributes .
我们将将此作为 +1 添加到功能请求中,以通过 CloudFormation 支持此功能。
关于amazon-web-services - AWS Cognito - 如何使用 CloudFormation 创建允许使用电子邮件地址注册的池?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46619746/