【发布时间】: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