diff --git a/lambdas/email_receipt_confirmation/lambda.tf b/lambdas/email_receipt_confirmation/lambda.tf index 4d2ec04..6e41b6c 100644 --- a/lambdas/email_receipt_confirmation/lambda.tf +++ b/lambdas/email_receipt_confirmation/lambda.tf @@ -54,8 +54,18 @@ module "lambda_function_container_image" { ses = { effect = "Allow" - resources = [local.ses_arn] - actions = ["ses:SendEmail"] + resources = [local.ses_arn, "arn:aws:ses:${var.aws_region}:${data.aws_caller_identity.current.account_id}:*"] + actions = ["ses:SendEmail", "ses:SendRawEmail"] + } + + + create_current_version_allowed_triggers = false + + allowed_triggers = { + ses = { + principal = "ses.amazonaws.com" + source_arn = "arn:aws:ses:${var.aws_region}:${data.aws_caller_identity.current.account_id}:receipt-rule-set/${var.rule_set_name}:receipt-rule/${var.chat_rule_name}" + } } } }