- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
Hello,
Thank you for posting on AWS re:Post!
I understood that you have added post authentication lambda trigger to your userpool but when you have tried testing by logging in to Cognito, it didn't got invoked.
Firstly, I would like to provide you below AWS reference document for understanding the important consideration while using lambda trigger with Cognito.
You have mentioned that post authentication lambda trigger didn't got invoked after authentication. In order for Cognito to invoke lambda function, you need to associated following resource based policy to your lambda function.
{
"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>"
}
}
}
]
}
Please attach this resource based policy to your lambda function to allow Cognito userpool to invoke the function.
I hope this information will be helpful to you.
Thank you!!
Contenuto pertinente
- AWS UFFICIALEAggiornata un anno fa
- AWS UFFICIALEAggiornata un anno fa
- AWS UFFICIALEAggiornata un anno fa
- AWS UFFICIALEAggiornata 2 anni fa