【发布时间】:2021-01-31 22:21:23
【问题描述】:
我正在尝试使用 CloudFormation 创建 Cognito 用户池,但在创建时不断收到以下错误:
Required custom attributes are not supported currently. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: d21bec3f-adca-4c38-a91a-fa59f16a2cdc; Proxy: null)
错误消息说我正在尝试创建自定义属性,但我只是尝试为标准属性指定行为,例如email、username 和 preferred_username。
AWS 文档在这里没有多大帮助。有什么线索吗? 请参阅下面的我的 CF 代码:
CognitoUserPool:
Type: AWS::Cognito::UserPool
Properties:
AccountRecoverySetting: # Defines which verified available method a user can use to recover their password when they call ForgotPassword
RecoveryMechanisms:
- Name: "verified_email"
Priority: 1
AdminCreateUserConfig:
AllowAdminCreateUserOnly: False
Policies:
PasswordPolicy:
MinimumLength: 6
RequireLowercase: False
RequireNumbers: False
RequireSymbols: False
RequireUppercase: False
TemporaryPasswordValidityDays: 7
Schema:
- AttributeDataType: "String"
Mutable: False
Name: "email"
Required: True
- AttributeDataType: "String"
Mutable: False
Name: "username"
Required: True
- AttributeDataType: "String"
Mutable: True
Name: "preferred_username"
Required: True
UsernameAttributes: # This user pool property cannot be updated
- "email"
UserPoolName: !Sub "${ProjectName}-userPool-${BranchName}"
感谢您的帮助, 乔尔
【问题讨论】:
标签: amazon-web-services amazon-cloudformation amazon-cognito aws-userpools