将Cognito验证类型设置为CloudFormation中的链接

Phi*_*ipp 10 amazon-web-services aws-cloudformation amazon-cognito

我试图找出如何在(我的)CloudFormation模板中将验证类型设置为Code(默认)Link.

在网站上我可以在这里设置: 例

如果我看一下这些文档,就没有提到.我的CloudFormation看起来像

SomeUserPoolResourceName:
  Type: AWS::Cognito::UserPool
  Properties:
    UserPoolName: SomeResource_User_Pool
    EmailVerificationType: Link  # I want something like this
    EmailVerificationSubject: 'Your verification link'
    EmailVerificationMessage: 'Please click the link below to verify your email address. {##Verify Email##}' # fails because {####} is required
    AliasAttributes:
      - email
    AutoVerifiedAttributes:
      - email
    Policies:
      PasswordPolicy:
        - .... 
    Schema:
      - ....
Run Code Online (Sandbox Code Playgroud)

是否可以通过CloudFormation进行配置?

age*_*420 9

不,目前不可能.根据更新的CreateUserPool API,新的VerificationMessageTemplate参数将允许我们执行此操作,但cloudformation尚未支持此功能.AWS Support表示存在针对该功能的现有功能请求.您可以查看自定义云信息资源作为解决方法.


小智 7

尝试这个:

SomeUserPoolResourceName:
  Type: AWS::Cognito::UserPool
  Properties:
    UserPoolName: SomeResource_User_Pool
    VerificationMessageTemplate:
       DefaultEmailOption: CONFIRM_WITH_LINK
    EmailVerificationSubject: 'Your verification link'
    EmailVerificationMessage: 'Please click the link below to verify your email address. {##Verify Email##}' # fails because {####} is required
    AliasAttributes:
      - email
    AutoVerifiedAttributes:
      - email
    Policies:
      PasswordPolicy:
        - .... 
    Schema:
Run Code Online (Sandbox Code Playgroud)

改变这部分:

EmailVerificationType: Link  # I want something like this
Run Code Online (Sandbox Code Playgroud)

为了:

VerificationMessageTemplate:
  DefaultEmailOption: CONFIRM_WITH_LINK
Run Code Online (Sandbox Code Playgroud)