I can't understand why the Cognito Lambda triggers are not created. The lambdas are created, but the list of triggers in the AWS console is empty and I have to choose them manually.
const postConfirmationLambda = new NodejsFunction(
this,
'PostConfirmLambda',
userPoolLambdasProps
);
const postAuthenticationLambda = new NodejsFunction(
this,
'PostAuthLambda',
userPoolLambdasProps
);
usersTable.grantReadWriteData(postConfirmationLambda);
usersTable.grantReadWriteData(postAuthenticationLambda);
const userPool = new UserPool(this, 'UserPool', {
removalPolicy: RemovalPolicy.DESTROY,
lambdaTriggers: {
postConfirmationLambda,
postAuthenticationLambda,
},
});