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?

1 Respuesta
1
Respuesta aceptada

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>"
                }
            }
        }
    ]
}
respondido hace 8 meses
  • 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.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas