Cognito User Pool not recognized in lambda trigger

0

After successfully creating an AWS cognito User Pool, I wanted to insert a lambda trigger for sign-up flow. Creating Lambda function from cognito

But the created lambda does not have a trigger Lambda with no trigger

Even if I want to create a manual trigger on the lambda It does not recognize the User Pool I Created Lambda trigger

If I create a lambda function first, however, I can see it from the cognito User Pool trigger menu. But after linking the lambda, it still has no trigger Enter image description here

I have looked at these common errors without luck There is no error pop-up or any other feedback I am in the same region in both the User Pool and Lambda. The lambda function has the right Resource-based policy statement Policy

How can I make it so that my lambda function trigger recognizes the Cognito User Pool?

Julio
已提问 8 个月前216 查看次数
1 回答
1
已接受的回答

Hi,

Cognito does not create the Lambda's Trigger.

You should check whether the Lambda's Permissions contain a Resource-based policy statements like this:

{
    "Version": "2012-10-17",
    "Id": "default",
    "Statement": [
        {
            "Sid": "lambda-allow-cognito",
            "Effect": "Allow",
            "Principal": {
                "Service": "cognito-idp.amazonaws.com"
            },
            "Action": "lambda:InvokeFunction",
            "Resource": "<your Lambda function ARN>",
            "Condition": {
                "StringEquals": {
                    "AWS:SourceAccount": "<your account number>"
                },
                "ArnLike": {
                    "AWS:SourceArn": "<your user pool ARN>"
                }
            }
        }
    ]
}
已回答 8 个月前
  • Yes, it does have a Resource-based policy statement like the one you mentioned. (I edited the question to show it)

  • This resource-based policy means you're already successful. The Lambda in my own environment does not have a Trigger, but the Lambda runs fine.

  • You're right. It fires fine. It's just misleading that the trigger does not show up in the lambda function overview.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则