【问题标题】:AWS Cognito does not use my custom message lambdaAWS Cognito 不使用我的自定义消息 lambda
【发布时间】:2021-04-22 04:38:00
【问题描述】:

我通过 Terraform 创建了一个 AWS Cognito 用户池,如下所示:

resource "aws_cognito_user_pool" "users-base" {
  name     = "users"
  provider = aws.eu-west-1

  auto_verified_attributes   = ["email"]
  username_attributes        = ["email"]

  account_recovery_setting {
    recovery_mechanism {
      name     = "verified_email"
      priority = 1
    }
    recovery_mechanism {
      name     = "verified_phone_number"
      priority = 2
    }
  }

  admin_create_user_config {
    allow_admin_create_user_only = false
  }

  email_configuration {
    email_sending_account = "DEVELOPER"
    from_email_address    = "No-reply <no-reply@acme.com>"
    source_arn            = aws_ses_email_identity.no-reply.arn
  }

  lambda_config {
    custom_message = aws_lambda_function.cognito-users-base.arn
  }
}

虽然我希望我的用户收到从aws_lambda_function.cognito-users-base 生成的邮件(配置正确,因为它之前生成了错误),但他们仍然收到根据verification_message_template.email_message_by_link 生成的邮件,我错过了什么?

编辑:我还检查了生成的 smsMessage 少于 140 个字符,并且 emailMessage 少于 20.000。此外,当我添加属性时,SignUp 进程会阻塞,因此会以一种方式调用 lambda。

【问题讨论】:

    标签: amazon-web-services aws-lambda terraform amazon-cognito


    【解决方案1】:

    看起来我的 lambda 正在生成一个没有 {##Some text##} 的主体,导致生成的主体被静默丢弃。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-17
      • 1970-01-01
      • 1970-01-01
      • 2018-12-17
      • 2018-09-04
      • 1970-01-01
      • 2019-04-05
      • 2020-12-18
      相关资源
      最近更新 更多