aws-cdk-lib.aws_cognito.UserPoolOperation

class UserPoolOperation

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

User pool operations to which lambda triggers can be attached.

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
operationNamestringThe key to use in CfnUserPool.LambdaConfigProperty.
static CREATE_AUTH_CHALLENGEUserPoolOperationCreates a challenge in a custom auth flow.
static CUSTOM_EMAIL_SENDERUserPoolOperationAmazon Cognito invokes this trigger to send email notifications to users.
static CUSTOM_MESSAGEUserPoolOperationAdvanced customization and localization of messages.
static CUSTOM_SMS_SENDERUserPoolOperationAmazon Cognito invokes this trigger to send email notifications to users.
static DEFINE_AUTH_CHALLENGEUserPoolOperationDetermines the next challenge in a custom auth flow.
static POST_AUTHENTICATIONUserPoolOperationEvent logging for custom analytics.
static POST_CONFIRMATIONUserPoolOperationCustom welcome messages or event logging for custom analytics.
static PRE_AUTHENTICATIONUserPoolOperationCustom validation to accept or deny the sign-in request.
static PRE_SIGN_UPUserPoolOperationCustom validation to accept or deny the sign-up request.
static PRE_TOKEN_GENERATIONUserPoolOperationAdd or remove attributes in Id tokens.
static USER_MIGRATIONUserPoolOperationMigrate a user from an existing user directory to user pools.
static VERIFY_AUTH_CHALLENGE_RESPONSEUserPoolOperationDetermines if a response is correct in a custom auth flow.

operationName

Type: string

The key to use in CfnUserPool.LambdaConfigProperty.


static CREATE_AUTH_CHALLENGE

Type: UserPoolOperation

Creates a challenge in a custom auth flow.

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


static CUSTOM_EMAIL_SENDER

Type: UserPoolOperation

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


static CUSTOM_MESSAGE

Type: UserPoolOperation

Advanced customization and localization of messages.

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


static CUSTOM_SMS_SENDER

Type: UserPoolOperation

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-sms-sender.html


static DEFINE_AUTH_CHALLENGE

Type: UserPoolOperation

Determines the next challenge in a custom auth flow.

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


static POST_AUTHENTICATION

Type: UserPoolOperation

Event logging for custom analytics.

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


static POST_CONFIRMATION

Type: UserPoolOperation

Custom welcome messages or event logging for custom analytics.

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


static PRE_AUTHENTICATION

Type: UserPoolOperation

Custom validation to accept or deny the sign-in request.

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


static PRE_SIGN_UP

Type: UserPoolOperation

Custom validation to accept or deny the sign-up request.

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


static PRE_TOKEN_GENERATION

Type: UserPoolOperation

Add or remove attributes in Id tokens.

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


static USER_MIGRATION

Type: UserPoolOperation

Migrate a user from an existing user directory to user pools.

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


static VERIFY_AUTH_CHALLENGE_RESPONSE

Type: UserPoolOperation

Determines if a response is correct in a custom auth flow.

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

Methods

NameDescription
static of(name)A custom user pool operation.

static of(name)

public static of(name: string): UserPoolOperation

Parameters

  • name string

Returns

  • UserPoolOperation

A custom user pool operation.