Skip to content
v2.277.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',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cognito as cognito

lambda_config_property = cognito.CfnUserPool.LambdaConfigProperty(
    create_auth_challenge="createAuthChallenge",
    custom_email_sender=cognito.CfnUserPool.CustomEmailSenderProperty(
        lambda_arn="lambdaArn",
        lambda_version="lambdaVersion"
    ),
    custom_message="customMessage",
    custom_sms_sender=cognito.CfnUserPool.CustomSMSSenderProperty(
        lambda_arn="lambdaArn",
        lambda_version="lambdaVersion"
    ),
    define_auth_challenge="defineAuthChallenge",
    inbound_federation=cognito.CfnUserPool.InboundFederationProperty(
        lambda_arn="lambdaArn",
        lambda_version="lambdaVersion"
    ),
    kms_key_id="kmsKeyId",
    post_authentication="postAuthentication",
    post_confirmation="postConfirmation",
    pre_authentication="preAuthentication",
    pre_sign_up="preSignUp",
    pre_token_generation="preTokenGeneration",
    pre_token_generation_config=cognito.CfnUserPool.PreTokenGenerationConfigProperty(
        lambda_arn="lambdaArn",
        lambda_version="lambdaVersion"
    ),
    user_migration="userMigration",
    verify_auth_challenge_response="verifyAuthChallengeResponse"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cognito.*;

LambdaConfigProperty lambdaConfigProperty = LambdaConfigProperty.builder()
        .createAuthChallenge("createAuthChallenge")
        .customEmailSender(CustomEmailSenderProperty.builder()
                .lambdaArn("lambdaArn")
                .lambdaVersion("lambdaVersion")
                .build())
        .customMessage("customMessage")
        .customSmsSender(CustomSMSSenderProperty.builder()
                .lambdaArn("lambdaArn")
                .lambdaVersion("lambdaVersion")
                .build())
        .defineAuthChallenge("defineAuthChallenge")
        .inboundFederation(InboundFederationProperty.builder()
                .lambdaArn("lambdaArn")
                .lambdaVersion("lambdaVersion")
                .build())
        .kmsKeyId("kmsKeyId")
        .postAuthentication("postAuthentication")
        .postConfirmation("postConfirmation")
        .preAuthentication("preAuthentication")
        .preSignUp("preSignUp")
        .preTokenGeneration("preTokenGeneration")
        .preTokenGenerationConfig(PreTokenGenerationConfigProperty.builder()
                .lambdaArn("lambdaArn")
                .lambdaVersion("lambdaVersion")
                .build())
        .userMigration("userMigration")
        .verifyAuthChallengeResponse("verifyAuthChallengeResponse")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Cognito;

var lambdaConfigProperty = new LambdaConfigProperty {
    CreateAuthChallenge = "createAuthChallenge",
    CustomEmailSender = new CustomEmailSenderProperty {
        LambdaArn = "lambdaArn",
        LambdaVersion = "lambdaVersion"
    },
    CustomMessage = "customMessage",
    CustomSmsSender = new CustomSMSSenderProperty {
        LambdaArn = "lambdaArn",
        LambdaVersion = "lambdaVersion"
    },
    DefineAuthChallenge = "defineAuthChallenge",
    InboundFederation = new InboundFederationProperty {
        LambdaArn = "lambdaArn",
        LambdaVersion = "lambdaVersion"
    },
    KmsKeyId = "kmsKeyId",
    PostAuthentication = "postAuthentication",
    PostConfirmation = "postConfirmation",
    PreAuthentication = "preAuthentication",
    PreSignUp = "preSignUp",
    PreTokenGeneration = "preTokenGeneration",
    PreTokenGenerationConfig = new PreTokenGenerationConfigProperty {
        LambdaArn = "lambdaArn",
        LambdaVersion = "lambdaVersion"
    },
    UserMigration = "userMigration",
    VerifyAuthChallengeResponse = "verifyAuthChallengeResponse"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

lambdaConfigProperty := &LambdaConfigProperty{
	CreateAuthChallenge: jsii.String("createAuthChallenge"),
	CustomEmailSender: &CustomEmailSenderProperty{
		LambdaArn: jsii.String("lambdaArn"),
		LambdaVersion: jsii.String("lambdaVersion"),
	},
	CustomMessage: jsii.String("customMessage"),
	CustomSmsSender: &CustomSMSSenderProperty{
		LambdaArn: jsii.String("lambdaArn"),
		LambdaVersion: jsii.String("lambdaVersion"),
	},
	DefineAuthChallenge: jsii.String("defineAuthChallenge"),
	InboundFederation: &InboundFederationProperty{
		LambdaArn: jsii.String("lambdaArn"),
		LambdaVersion: jsii.String("lambdaVersion"),
	},
	KmsKeyId: jsii.String("kmsKeyId"),
	PostAuthentication: jsii.String("postAuthentication"),
	PostConfirmation: jsii.String("postConfirmation"),
	PreAuthentication: jsii.String("preAuthentication"),
	PreSignUp: jsii.String("preSignUp"),
	PreTokenGeneration: jsii.String("preTokenGeneration"),
	PreTokenGenerationConfig: &PreTokenGenerationConfigProperty{
		LambdaArn: jsii.String("lambdaArn"),
		LambdaVersion: jsii.String("lambdaVersion"),
	},
	UserMigration: jsii.String("userMigration"),
	VerifyAuthChallengeResponse: jsii.String("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 .
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 .
inboundFederationoptionalIResolvable | CfnUserPool.InboundFederationPropertyinbound_federationoptionaltyping.Union[IResolvable, InboundFederationProperty]inboundFederationoptionalIResolvableInboundFederationoptionalIResolvableInboundFederationoptionalinterface{} #
kmsKeyIdoptionalstringkms_key_idoptionalstrkmsKeyIdoptionalStringKmsKeyIdoptionalstringKmsKeyIdoptional*string #
The ARN of an KMS key . 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 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 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 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 in a user pool. This trigger evaluates new users and can bypass confirmation, link a federated user profile , or block sign-up requests.
preTokenGenerationoptionalstringpre_token_generationoptionalstrpreTokenGenerationoptionalStringPreTokenGenerationoptionalstringPreTokenGenerationoptional*string #
The legacy configuration of a pre token generation Lambda trigger 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 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 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 .