class UserPoolOperation
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Cognito.UserPoolOperation |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscognito#UserPoolOperation |
![]() | software.amazon.awscdk.services.cognito.UserPoolOperation |
![]() | aws_cdk.aws_cognito.UserPoolOperation |
![]() | 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_LATEST,
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_LATEST,
handler: 'index.handler',
code: lambda.Code.fromAsset(path.join(__dirname, 'path/to/asset')),
}));
Properties
Name | Type | Description |
---|---|---|
operation | string | The key to use in CfnUserPool.LambdaConfigProperty . |
static CREATE_AUTH_CHALLENGE | User | Creates a challenge in a custom auth flow. |
static CUSTOM_EMAIL_SENDER | User | Amazon Cognito invokes this trigger to send email notifications to users. |
static CUSTOM_MESSAGE | User | Advanced customization and localization of messages. |
static CUSTOM_SMS_SENDER | User | Amazon Cognito invokes this trigger to send email notifications to users. |
static DEFINE_AUTH_CHALLENGE | User | Determines the next challenge in a custom auth flow. |
static POST_AUTHENTICATION | User | Event logging for custom analytics. |
static POST_CONFIRMATION | User | Custom welcome messages or event logging for custom analytics. |
static PRE_AUTHENTICATION | User | Custom validation to accept or deny the sign-in request. |
static PRE_SIGN_UP | User | Custom validation to accept or deny the sign-up request. |
static PRE_TOKEN_GENERATION | User | Add or remove attributes in Id tokens. |
static PRE_TOKEN_GENERATION_CONFIG | User | Add or remove attributes in Id tokens. |
static USER_MIGRATION | User | Migrate a user from an existing user directory to user pools. |
static VERIFY_AUTH_CHALLENGE_RESPONSE | User | Determines 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:
User
Creates a challenge in a custom auth flow.
static CUSTOM_EMAIL_SENDER
Type:
User
Amazon Cognito invokes this trigger to send email notifications to users.
static CUSTOM_MESSAGE
Type:
User
Advanced customization and localization of messages.
static CUSTOM_SMS_SENDER
Type:
User
Amazon Cognito invokes this trigger to send email notifications to users.
static DEFINE_AUTH_CHALLENGE
Type:
User
Determines the next challenge in a custom auth flow.
static POST_AUTHENTICATION
Type:
User
Event logging for custom analytics.
static POST_CONFIRMATION
Type:
User
Custom welcome messages or event logging for custom analytics.
static PRE_AUTHENTICATION
Type:
User
Custom validation to accept or deny the sign-in request.
static PRE_SIGN_UP
Type:
User
Custom validation to accept or deny the sign-up request.
static PRE_TOKEN_GENERATION
Type:
User
Add or remove attributes in Id tokens.
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.
static PRE_TOKEN_GENERATION_CONFIG
Type:
User
Add or remove attributes in Id tokens.
static USER_MIGRATION
Type:
User
Migrate a user from an existing user directory to user pools.
static VERIFY_AUTH_CHALLENGE_RESPONSE
Type:
User
Determines if a response is correct in a custom auth flow.
Methods
Name | Description |
---|---|
static of(name) | A custom user pool operation. |
static of(name)
public static of(name: string): UserPoolOperation
Parameters
- name
string
Returns
A custom user pool operation.