aws-cdk-lib.aws_cognito.UserPoolTriggers

interface UserPoolTriggers

LanguageType name
.NETAmazon.CDK.AWS.Cognito.UserPoolTriggers
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscognito#UserPoolTriggers
Javasoftware.amazon.awscdk.services.cognito.UserPoolTriggers
Pythonaws_cdk.aws_cognito.UserPoolTriggers
TypeScript (source)aws-cdk-lib » aws_cognito » UserPoolTriggers

Triggers for a user pool.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html

Example

const authChallengeFn = new lambda.Function(this, 'authChallengeFn', {
  runtime: lambda.Runtime.NODEJS_14_X,
  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_14_X,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'path/to/asset')),
}));

Properties

NameTypeDescription
createAuthChallenge?IFunctionCreates an authentication challenge.
customEmailSender?IFunctionAmazon Cognito invokes this trigger to send email notifications to users.
customMessage?IFunctionA custom Message AWS Lambda trigger.
customSmsSender?IFunctionAmazon Cognito invokes this trigger to send SMS notifications to users.
defineAuthChallenge?IFunctionDefines the authentication challenge.
postAuthentication?IFunctionA post-authentication AWS Lambda trigger.
postConfirmation?IFunctionA post-confirmation AWS Lambda trigger.
preAuthentication?IFunctionA pre-authentication AWS Lambda trigger.
preSignUp?IFunctionA pre-registration AWS Lambda trigger.
preTokenGeneration?IFunctionA pre-token-generation AWS Lambda trigger.
userMigration?IFunctionA user-migration AWS Lambda trigger.
verifyAuthChallengeResponse?IFunctionVerifies the authentication challenge response.

createAuthChallenge?

Type: IFunction (optional, default: no trigger configured)

Creates an authentication challenge.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-create-auth-challenge.html


customEmailSender?

Type: IFunction (optional, default: no trigger configured)

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

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-email-sender.html


customMessage?

Type: IFunction (optional, default: no trigger configured)

A custom Message AWS Lambda trigger.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-message.html


customSmsSender?

Type: IFunction (optional, default: no trigger configured)

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

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html


defineAuthChallenge?

Type: IFunction (optional, default: no trigger configured)

Defines the authentication challenge.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-define-auth-challenge.html


postAuthentication?

Type: IFunction (optional, default: no trigger configured)

A post-authentication AWS Lambda trigger.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-authentication.html


postConfirmation?

Type: IFunction (optional, default: no trigger configured)

A post-confirmation AWS Lambda trigger.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html


preAuthentication?

Type: IFunction (optional, default: no trigger configured)

A pre-authentication AWS Lambda trigger.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-authentication.html


preSignUp?

Type: IFunction (optional, default: no trigger configured)

A pre-registration AWS Lambda trigger.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html


preTokenGeneration?

Type: IFunction (optional, default: no trigger configured)

A pre-token-generation AWS Lambda trigger.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html


userMigration?

Type: IFunction (optional, default: no trigger configured)

A user-migration AWS Lambda trigger.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-migrate-user.html


verifyAuthChallengeResponse?

Type: IFunction (optional, default: no trigger configured)

Verifies the authentication challenge response.

See also: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-verify-auth-challenge-response.html