I have created a SAM template with a function in it. After deploying SAM the lambda function gets added and are also displayed while adding lambda function trigger in cognito but when I save it gives a 404 error.
SAM template
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >-
description
Globals:
Function:
CodeUri: .
Runtime: nodejs14.x
Resources:
function1:
Type: 'AWS::Serverless::Function'
Properties:
FunctionName: function1
Handler: dist/handlers/fun1.handler
error in cognito while adding trigger
[404 Not Found] Allowing Cognito to invoke lambda function cannot be completed.
ResourceNotFoundException (Request ID: e963254b-8d2a-49fa-b012-xxxxxxxx)
Note - if I add a Cognito Sync trigger
in the lambda config dashboard and then try to configure a trigger in the user pool it works.