UserPoolTriggerEventSource
Source:
src/AWS/Lambda/UserPoolTriggerEventSource.ts
Connects a Cognito user pool Lambda trigger to the current Lambda function.
At deploy time this layer injects the function ARN into the pool’s
LambdaConfig through the pool’s binding contract and materializes the
lambda:InvokeFunction Permission for cognito-idp.amazonaws.com; at
runtime it dispatches matching trigger events (matched on userPoolId +
triggerSource prefix) to the registered handler and returns the
handler’s (mutated) event to Cognito.
Handling user pool triggers
Section titled “Handling user pool triggers”yield* Cognito.onPreSignUp(pool, (event) => Effect.sync(() => Cognito.autoConfirmUser(event, { verifyEmail: true })),);