我正在使用 Terraform 创建 Cognito 用户池。我想使用 lambda 函数在用户注册时发送自定义消息。当我在客户端上运行尝试注册时,收到一条错误消息“CustomMessage 调用因错误 AccessDeniedException 而失败。” 我以前使用过 Lambda Permissions,但找不到此配置的任何示例。如何授予 lambda 函数权限?以下是我当前的配置。
resource "aws_cognito_user_pool" "main" {
name = "${var.user_pool_name}_${var.stage}"
username_attributes = [ "email" ]
schema {
attribute_data_type = "String"
mutable = true
name = "name"
required = true
}
schema {
attribute_data_type = "String"
mutable = true
name = "email"
required = true
}
password_policy {
minimum_length = "8"
require_lowercase = true
require_numbers = true
require_symbols = true
require_uppercase = true
}
mfa_configuration = "OFF"
lambda_config { …Run Code Online (Sandbox Code Playgroud)