Skip to content
v2.275.0

LambdaConfigProperty Struct ​

A collection of user pool Lambda triggers.

Amazon Cognito invokes triggers at several possible stages of user pool operations. Triggers can modify the outcome of the operations that invoked them.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cognito as cognito } from 'aws-cdk-lib';
const lambdaConfigProperty: cognito.CfnUserPool.LambdaConfigProperty = {
  createAuthChallenge: 'createAuthChallenge',
  customEmailSender: {
    lambdaArn: 'lambdaArn',
    lambdaVersion: 'lambdaVersion',
  },
  customMessage: 'customMessage',
  customSmsSender: {
    lambdaArn: 'lambdaArn',
    lambdaVersion: 'lambdaVersion',
  },
  defineAuthChallenge: 'defineAuthChallenge',
  inboundFederation: {
    lambdaArn: 'lambdaArn',
    lambdaVersion: 'lambdaVersion',
  },
  kmsKeyId: 'kmsKeyId',
  postAuthentication: 'postAuthentication',
  postConfirmation: 'postConfirmation',
  preAuthentication: 'preAuthentication',
  preSignUp: 'preSignUp',
  preTokenGeneration: 'preTokenGeneration',
  preTokenGenerationConfig: {
    lambdaArn: 'lambdaArn',
    lambdaVersion: 'lambdaVersion',
  },
  userMigration: 'userMigration',
  verifyAuthChallengeResponse: 'verifyAuthChallengeResponse',
};

Properties ​

createAuthChallengeoptionalstringcreate_auth_challengeoptionalstrcreateAuthChallengeoptionalStringCreateAuthChallengeoptionalstringCreateAuthChallengeoptional*string#
The configuration of a create auth challenge Lambda trigger, one of three triggers in the sequence of the [custom authentication challenge triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-challenge.html) .
customEmailSenderoptionalIResolvable | CfnUserPool.CustomEmailSenderPropertycustom_email_senderoptionaltyping.Union[IResolvable, CustomEmailSenderProperty]customEmailSenderoptionalIResolvableCustomEmailSenderoptionalIResolvableCustomEmailSenderoptionalinterface{}#
The configuration of a custom email sender Lambda trigger.

This trigger routes all email notifications from a user pool to a Lambda function that delivers the message using custom logic.

customMessageoptionalstringcustom_messageoptionalstrcustomMessageoptionalStringCustomMessageoptionalstringCustomMessageoptional*string#
A custom message Lambda trigger.
notes

This trigger is an opportunity to customize all SMS and email messages from your user pool. When a custom message trigger is active, your user pool routes all messages to a Lambda function that returns a runtime-customized message subject and body for your user pool to deliver to a user.

customSmsSenderoptionalIResolvable | CfnUserPool.CustomSMSSenderPropertycustom_sms_senderoptionaltyping.Union[IResolvable, CustomSMSSenderProperty]customSmsSenderoptionalIResolvableCustomSmsSenderoptionalIResolvableCustomSmsSenderoptionalinterface{}#
The configuration of a custom SMS sender Lambda trigger.

This trigger routes all SMS notifications from a user pool to a Lambda function that delivers the message using custom logic.

defineAuthChallengeoptionalstringdefine_auth_challengeoptionalstrdefineAuthChallengeoptionalStringDefineAuthChallengeoptionalstringDefineAuthChallengeoptional*string#
The configuration of a define auth challenge Lambda trigger, one of three triggers in the sequence of the [custom authentication challenge triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-challenge.html) .
inboundFederationoptionalIResolvable | CfnUserPool.InboundFederationPropertyinbound_federationoptionaltyping.Union[IResolvable, InboundFederationProperty]inboundFederationoptionalIResolvableInboundFederationoptionalIResolvableInboundFederationoptionalinterface{}#
kmsKeyIdoptionalstringkms_key_idoptionalstrkmsKeyIdoptionalStringKmsKeyIdoptionalstringKmsKeyIdoptional*string#
The ARN of an [KMS key](https://docs.aws.amazon.com//kms/latest/developerguide/concepts.html#master_keys) . Amazon Cognito uses the key to encrypt codes and temporary passwords sent to custom sender Lambda triggers.
postAuthenticationoptionalstringpost_authenticationoptionalstrpostAuthenticationoptionalStringPostAuthenticationoptionalstringPostAuthenticationoptional*string#
The configuration of a [post authentication Lambda trigger](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-authentication.html) in a user pool. This trigger can take custom actions after a user signs in.
postConfirmationoptionalstringpost_confirmationoptionalstrpostConfirmationoptionalStringPostConfirmationoptionalstringPostConfirmationoptional*string#
The configuration of a [post confirmation Lambda trigger](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html) in a user pool. This trigger can take custom actions after a user confirms their user account and their email address or phone number.
preAuthenticationoptionalstringpre_authenticationoptionalstrpreAuthenticationoptionalStringPreAuthenticationoptionalstringPreAuthenticationoptional*string#
The configuration of a [pre authentication trigger](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-authentication.html) in a user pool. This trigger can evaluate and modify user sign-in events.
preSignUpoptionalstringpre_sign_upoptionalstrpreSignUpoptionalStringPreSignUpoptionalstringPreSignUpoptional*string#
The configuration of a [pre sign-up Lambda trigger](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html) in a user pool. This trigger evaluates new users and can bypass confirmation, [link a federated user profile](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-identity-federation-consolidate-users.html) , or block sign-up requests.
preTokenGenerationoptionalstringpre_token_generationoptionalstrpreTokenGenerationoptionalStringPreTokenGenerationoptionalstringPreTokenGenerationoptional*string#
The legacy configuration of a [pre token generation Lambda trigger](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html) in a user pool.
notes

Set this parameter for legacy purposes. If you also set an ARN in PreTokenGenerationConfig , its value must be identical to PreTokenGeneration . For new instances of pre token generation triggers, set the LambdaArn of PreTokenGenerationConfig .

preTokenGenerationConfigoptionalIResolvable | CfnUserPool.PreTokenGenerationConfigPropertypre_token_generation_configoptionaltyping.Union[IResolvable, PreTokenGenerationConfigProperty]preTokenGenerationConfigoptionalIResolvablePreTokenGenerationConfigoptionalIResolvablePreTokenGenerationConfigoptionalinterface{}#
The detailed configuration of a [pre token generation Lambda trigger](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html) in a user pool. If you also set an ARN in `PreTokenGeneration` , its value must be identical to `PreTokenGenerationConfig` .
userMigrationoptionalstringuser_migrationoptionalstruserMigrationoptionalStringUserMigrationoptionalstringUserMigrationoptional*string#
The configuration of a [migrate user Lambda trigger](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-migrate-user.html) in a user pool. This trigger can create user profiles when users sign in or attempt to reset their password with credentials that don't exist yet.
verifyAuthChallengeResponseoptionalstringverify_auth_challenge_responseoptionalstrverifyAuthChallengeResponseoptionalStringVerifyAuthChallengeResponseoptionalstringVerifyAuthChallengeResponseoptional*string#
The configuration of a verify auth challenge Lambda trigger, one of three triggers in the sequence of the [custom authentication challenge triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-challenge.html) .