简体   繁体   English

通过具有属性更新的 CloudFormation 部署 AWS UserPool

[英]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.这只是失败的更新,部署干净的堆栈正确地将emailname标准属性设置为必需。

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:进行更新的唯一可行方法是分两步完成:

  1. Remove the attribute that has to be changed (in your case name ), deploy the CloudFormation删除必须更改的属性(在您的案例name ),部署 CloudFormation
  2. Add the attribute with the correct values (so adding Require: true in your case), deploy the CloudFormation添加具有正确值的属性(因此在您的情况下添加Require: 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.

相关问题 通过Cloudformation文件的AWS Cognito Userpool - AWS Cognito Userpool via cloudformation file AWS Cognito UserPool RecoveryOptions - CloudFormation 与控制台 - AWS Cognito UserPool RecoveryOptions - CloudFormation vs Console 部署时出现AWS Lambda和Cognito错误:一次只能处理一个更新该UserPool的请求 - AWS Lambda and Cognito error on deploy: Only one request to update this UserPool can be processed at a time 将现有的 AWS Cognito 用户池连接到新的 Cloudformation 堆栈 - Connecting already exisiting AWS Cognito userpool to a new Cloudformation Stack 无法通过 cloudformation 设置 cognito 用户池客户端的属性 - Cannot set a property of cognito userpool client via cloudformation AWS Pipeline部署cloudformation - AWS Pipeline deploy cloudformation AWS Cognito OpenID/OIDC UserPool Identity:“需要用户名属性映射” - AWS Cognito OpenID/OIDC UserPool Identity : "username attribute mapping required" 预置资源以通过 AWS CloudFormation 部署 React(MERN)/Angular(MEAN) 应用程序 - Provision resources to deploy React(MERN)/Angular(MEAN) app via AWS CloudFormation 如果我通过 CloudFormation 部署 AWS,有什么方法可以阻止 AWS 自动启动 CodePipeline? - Is there any way to stop AWS from starting CodePipeline automatically if I deploy it via CloudFormation? 如何从 jenkins 部署(创建/更新/删除)cloudformation 模板到我的 AWS 环境? - How can I deploy (create/update/delete) cloudformation templates from jenkins to my AWS environment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM