Skip to content
v2.274.0

UserPoolTriggers Struct ​

Triggers for a user pool.

Example ​

ts
const authChallengeFn = new lambda.Function(this, 'authChallengeFn', {
  runtime: lambda.Runtime.NODEJS_LATEST,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'path/to/asset')),
});

const userpool = new cognito.UserPool(this, 'myuserpool', {
  // ...
  lambdaTriggers: {
    createAuthChallenge: authChallengeFn,
    // ...
  },
});

userpool.addTrigger(cognito.UserPoolOperation.USER_MIGRATION, new lambda.Function(this, 'userMigrationFn', {
    runtime: lambda.Runtime.NODEJS_LATEST,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'path/to/asset')),
}));

Properties ​

createAuthChallengeIFunctioncreate_auth_challengeIFunctioncreateAuthChallengeIFunctionCreateAuthChallengeIFunctionCreateAuthChallengeIFunction#
Creates an authentication challenge.

Default: no trigger configured

customEmailSenderIFunctioncustom_email_senderIFunctioncustomEmailSenderIFunctionCustomEmailSenderIFunctionCustomEmailSenderIFunction#
Amazon Cognito invokes this trigger to send email notifications to users.

Default: no trigger configured

customMessageIFunctioncustom_messageIFunctioncustomMessageIFunctionCustomMessageIFunctionCustomMessageIFunction#
A custom Message AWS Lambda trigger.

Default: no trigger configured

customSmsSenderIFunctioncustom_sms_senderIFunctioncustomSmsSenderIFunctionCustomSmsSenderIFunctionCustomSmsSenderIFunction#
Amazon Cognito invokes this trigger to send SMS notifications to users.

Default: no trigger configured

defineAuthChallengeIFunctiondefine_auth_challengeIFunctiondefineAuthChallengeIFunctionDefineAuthChallengeIFunctionDefineAuthChallengeIFunction#
Defines the authentication challenge.

Default: no trigger configured

postAuthenticationIFunctionpost_authenticationIFunctionpostAuthenticationIFunctionPostAuthenticationIFunctionPostAuthenticationIFunction#
A post-authentication AWS Lambda trigger.

Default: no trigger configured

postConfirmationIFunctionpost_confirmationIFunctionpostConfirmationIFunctionPostConfirmationIFunctionPostConfirmationIFunction#
A post-confirmation AWS Lambda trigger.

Default: no trigger configured

preAuthenticationIFunctionpre_authenticationIFunctionpreAuthenticationIFunctionPreAuthenticationIFunctionPreAuthenticationIFunction#
A pre-authentication AWS Lambda trigger.

Default: no trigger configured

preSignUpIFunctionpre_sign_upIFunctionpreSignUpIFunctionPreSignUpIFunctionPreSignUpIFunction#
A pre-registration AWS Lambda trigger.

Default: no trigger configured

preTokenGenerationIFunctionpre_token_generationIFunctionpreTokenGenerationIFunctionPreTokenGenerationIFunctionPreTokenGenerationIFunction#
A pre-token-generation AWS Lambda trigger.

Default: no trigger configured

userMigrationIFunctionuser_migrationIFunctionuserMigrationIFunctionUserMigrationIFunctionUserMigrationIFunction#
A user-migration AWS Lambda trigger.

Default: no trigger configured

verifyAuthChallengeResponseIFunctionverify_auth_challenge_responseIFunctionverifyAuthChallengeResponseIFunctionVerifyAuthChallengeResponseIFunctionVerifyAuthChallengeResponseIFunction#
Verifies the authentication challenge response.

Default: no trigger configured