[英]Deploy AWS UserPool via CloudFormation with attribute update
If you deploy a UserPool via CloudFormation, eg:如果您通过 CloudFormation 部署 UserPool,例如:
Resources:
UserPool:
Type: 'AWS::Cognito::UserPool'
Properties:
...
Schema:
- Name: email
AttributeDataType: String
Mutable: true
Required: true
and then update the attributes to make name
required:然后更新属性以使
name
必需:
Schema:
- Name: email
AttributeDataType: String
Mutable: true
Required: true
- Name: name
AttributeDataType: String
Mutable: true
Required: true
AWS thinks that name
is a custom attribute and fails with: AWS 认为
name
是一个自定义属性并且失败:
Required custom attributes are not supported currently.
当前不支持必需的自定义属性。 (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: ...)
(服务:AWSCognitoIdentityProviderService;状态代码:400;错误代码:InvalidParameterException;请求 ID:...)
It's only an update that fails, deploying a clean stack correctly sets both the email
and name
standard attributes to required.这只是失败的更新,部署干净的堆栈正确地将
email
和name
标准属性设置为必需。
Is there any way for the update to succeed?有没有办法让更新成功?
Unfortunately this is some sort of bug from CloudFormation.不幸的是,这是来自 CloudFormation 的某种错误。 Very similar to other issues, for example on the update of DynamoDB tables with more than one index.
与其他问题非常相似,例如更新具有多个索引的 DynamoDB 表。
The only feasible way to do the update is to do that in two steps:进行更新的唯一可行方法是分两步完成:
name
), deploy the CloudFormationname
),部署 CloudFormationRequire: true
in your case), deploy the CloudFormationRequire: true
),部署 CloudFormation As previously said there are quite a lot of issues similar to that case, and you'd better signal your issue to AWS in order to get support and the bug fixed.如前所述,有很多与该案例类似的问题,您最好将您的问题告知 AWS,以获得支持并修复错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.