UserPoolTriggers

class aws_cdk.aws_cognito.UserPoolTriggers(*, create_auth_challenge=None, custom_message=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_message (Optional[IFunction]) – A custom Message AWS Lambda trigger. 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

Example:

# Example automatically generated from non-compiling source. May contain errors.
auth_challenge_fn = lambda_.Function(self, "authChallengeFn",
    runtime=lambda_.Runtime.NODEJS_12_X,
    handler="index.handler",
    code=lambda_.Code.from_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_12_X,
    handler="index.handler",
    code=lambda_.Code.from_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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]

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

Return type

Optional[IFunction]