UserPoolTriggers

class aws_cdk.aws_cognito.UserPoolTriggers(*, create_auth_challenge=None, custom_email_sender=None, custom_message=None, custom_sms_sender=None, define_auth_challenge=None, post_authentication=None, post_confirmation=None, pre_authentication=None, pre_sign_up=None, pre_token_generation=None, user_migration=None, verify_auth_challenge_response=None)

Bases: object

Triggers for a user pool.

Parameters:
  • create_auth_challenge (Optional[IFunction]) – Creates an authentication challenge. Default: - no trigger configured

  • custom_email_sender (Optional[IFunction]) – Amazon Cognito invokes this trigger to send email notifications to users. Default: - no trigger configured

  • custom_message (Optional[IFunction]) – A custom Message AWS Lambda trigger. Default: - no trigger configured

  • custom_sms_sender (Optional[IFunction]) – Amazon Cognito invokes this trigger to send SMS notifications to users. Default: - no trigger configured

  • define_auth_challenge (Optional[IFunction]) – Defines the authentication challenge. Default: - no trigger configured

  • post_authentication (Optional[IFunction]) – A post-authentication AWS Lambda trigger. Default: - no trigger configured

  • post_confirmation (Optional[IFunction]) – A post-confirmation AWS Lambda trigger. Default: - no trigger configured

  • pre_authentication (Optional[IFunction]) – A pre-authentication AWS Lambda trigger. Default: - no trigger configured

  • pre_sign_up (Optional[IFunction]) – A pre-registration AWS Lambda trigger. Default: - no trigger configured

  • pre_token_generation (Optional[IFunction]) – A pre-token-generation AWS Lambda trigger. Default: - no trigger configured

  • user_migration (Optional[IFunction]) – A user-migration AWS Lambda trigger. Default: - no trigger configured

  • verify_auth_challenge_response (Optional[IFunction]) – Verifies the authentication challenge response. Default: - no trigger configured

See:

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

ExampleMetadata:

infused

Example:

auth_challenge_fn = lambda_.Function(self, "authChallengeFn",
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    code=lambda_.Code.from_asset(path.join(__dirname, "path/to/asset"))
)

userpool = cognito.UserPool(self, "myuserpool",
    # ...
    lambda_triggers=cognito.UserPoolTriggers(
        create_auth_challenge=auth_challenge_fn
    )
)

userpool.add_trigger(cognito.UserPoolOperation.USER_MIGRATION, lambda_.Function(self, "userMigrationFn",
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    code=lambda_.Code.from_asset(path.join(__dirname, "path/to/asset"))
))

Attributes

create_auth_challenge

Creates an authentication challenge.

Default:
  • no trigger configured

See:

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

custom_email_sender

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

Default:
  • no trigger configured

See:

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

custom_message

A custom Message AWS Lambda trigger.

Default:
  • no trigger configured

See:

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

custom_sms_sender

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

Default:
  • no trigger configured

See:

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

define_auth_challenge

Defines the authentication challenge.

Default:
  • no trigger configured

See:

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

post_authentication

A post-authentication AWS Lambda trigger.

Default:
  • no trigger configured

See:

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

post_confirmation

A post-confirmation AWS Lambda trigger.

Default:
  • no trigger configured

See:

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

pre_authentication

A pre-authentication AWS Lambda trigger.

Default:
  • no trigger configured

See:

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

pre_sign_up

A pre-registration AWS Lambda trigger.

Default:
  • no trigger configured

See:

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

pre_token_generation

A pre-token-generation AWS Lambda trigger.

Default:
  • no trigger configured

See:

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

user_migration

A user-migration AWS Lambda trigger.

Default:
  • no trigger configured

See:

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

verify_auth_challenge_response

Verifies the authentication challenge response.

Default:
  • no trigger configured

See:

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