1

我确实看到了此处列出的 RecoveryOption https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-recoveryoption.html

但是在 UserPool 中,我没有看到 RecoveryOption https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html

任何人都已经在 Cloudformation 中使用过 RecoveryOption。

如果这是一个文档问题或围绕它的任何限制,请提出建议。

4

2 回答 2

2

RecoveryOptions 是 RecoveryMechanism 的一部分,它是 AccountRecoverySetting 的一部分:

{
  "RecoveryMechanisms" : [ RecoveryOption, ... ]
}

这是一个具有恢复选项的用户池示例,将所有内容放在 CloudFormation 模板中,如下所示:

  testUserPool:
    DependsOn: [ cognitoSMSRole ]
    Type: AWS::Cognito::UserPool
    Properties:
      AccountRecoverySetting:
        RecoveryMechanisms: 
          - Name: verified_email
            Priority: 1
          - Name: verified_phone_number
            Priority: 2
      AdminCreateUserConfig: 
          AllowAdminCreateUserOnly: False
      AutoVerifiedAttributes: 
        - phone_number
      EnabledMfas: 
        - SMS_MFA
      MfaConfiguration: OPTIONAL
      Policies: 
        PasswordPolicy: 
          MinimumLength: 8
          RequireLowercase: True
          RequireNumbers: True
          RequireSymbols: True
          RequireUppercase: True
          TemporaryPasswordValidityDays: 7
      Schema: 
        - AttributeDataType: String
          DeveloperOnlyAttribute: False
          Mutable: False
          Name: name
          Required: True
        - AttributeDataType: String
          DeveloperOnlyAttribute: False
          Mutable: False
          Name: last_name
          Required: False
      SmsConfiguration:
          ExternalId: !Sub cognito-sms-role-prod
          SnsCallerArn: !GetAtt cognitoSMSRole.Arn
      UsernameAttributes: 
        - phone_number
      UsernameConfiguration: 
        CaseSensitive: False
      UserPoolName: !Sub UserPool-prod

于 2020-03-23T11:11:14.963 回答
0

我已经找到了 RecoveryOption。它在 AccountRecoverySetting https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-accountrecoverysetting

于 2020-03-23T11:08:24.353 回答