AWS Cognito:无法使用 aws cli 为 create-user-pool 设置一些属性

AWS Cognito: Unable to set some properties for create-user-pool using aws cli

我正在尝试使用来自 json 文件的 AWS CLI 在 cognito 上创建 user-pool。正在创建池,但我无法设置它的某些属性。

注意:下面附带的一些快照来自 AWS Docs for creating user pool

  1. 我找不到将电子邮件设置为验证属性的方法。

    快照:

  2. 虽然我在我的 json 文件中指定了电子邮件消息和主题,但它们并未被自定义。这让我想到另一个问题(第 3 点)。

  3. 通过 CLI 创建用户池的 AWS 文档提到了三个属性。

快照:

下面是我创建的JSONobject池

{
    "PoolName": "xxx-userpool-local",
    "Policies": {
        "PasswordPolicy": {
            "MinimumLength": 8,
            "RequireUppercase": true,
            "RequireLowercase": true,
            "RequireNumbers": true,
            "RequireSymbols": true,
            "TemporaryPasswordValidityDays": 7
        }
    },
    "UsernameAttributes": [
        "email"
    ],
    "EmailVerificationMessage": "Please click the link below to verify your account. {####}",
    "EmailVerificationSubject": "Your account is ready",
    "VerificationMessageTemplate": {
        "EmailMessage": "Please click the link below to verify your account. {####}",
        "EmailSubject": "Your account is ready",
        "EmailMessageByLink": "Please click the link below to verify your account. {####}",
        "EmailSubjectByLink": "Your account is ready",
        "DefaultEmailOption": "CONFIRM_WITH_LINK"
    },
    "AdminCreateUserConfig": {
        "AllowAdminCreateUserOnly": false
    },
    "UsernameConfiguration": {
        "CaseSensitive": true
    },
    "AccountRecoverySetting": {
        "RecoveryMechanisms": [
            {
                "Priority": 1,
                "Name": "verified_email"
            }
        ]
    }
}

  1. 控制台中的此选项映射到 CLI 中的 AutoVerifiedAttributes。为了将电子邮件设置为验证属性,请将以下代码片段添加到您的 JSON 输入:
"AutoVerifiedAttributes": [
 "email"
]
  1. 它映射到 CLI 中的 AdminCreateUserConfig.InviteMessageTemplate
"AdminCreateUserConfig": {
  "AllowAdminCreateUserOnly": false,
  "InviteMessageTemplate": {
    "EmailMessage": "Your username is {username} and temporary password is {####}. ",
    "EmailSubject": "Your temporary password"
  }
}
  1. 您可以使用以下配置 select 验证 link 作为选项而不是验证码。
"VerificationMessageTemplate": {
  "EmailMessageByLink": "Please click the link below to verify your email address. {##Verify Email##} ",
  "EmailSubjectByLink": "Your verification link",
  "DefaultEmailOption": "CONFIRM_WITH_LINK"
}