CognitoUserPool
Reference doc for the `sst.aws.CognitoUserPool` component.
The CognitoUserPool
component lets you add a Amazon Cognito user pool to your app.
Create the user pool
Login using email
Configure triggers
Add a client
Constructor
Parameters
-
name
string
-
args?
CognitoUserPoolArgs
-
opts?
ComponentResourceOptions
CognitoUserPoolArgs
aliases?
Type Input
<
Input
<
“
email
”
|
“
phone
”
|
“
preferred_username
”
>
[]
>
Default User can only sign in with their username.
Configure the different ways a user can sign in besides using their username.
transform?
transform.userPool?
Type UserPoolArgs
|
(
args
:
UserPoolArgs
=>
void
)
Transform the Cognito user pool resource.
triggers?
Type Input
<
Object
>
Default No triggers
Configure triggers for this User Pool
triggers.createAuthChallenge?
Type string
|
FunctionArgs
ARN of the lambda function to present a custom challenge and its answer.
triggers.customEmailSender?
Type string
|
FunctionArgs
ARN of the custom email sender function.
triggers.customMessage?
Type string
|
FunctionArgs
ARN of the lambda function to add customization and localization of verification, recovery, and MFA messages.
triggers.customSmsSender?
Type string
|
FunctionArgs
ARN of the custom SMS sender function.
triggers.defineAuthChallenge?
Type string
|
FunctionArgs
ARN of the lambda function to name a custom challenge.
triggers.postAuthentication?
Type string
|
FunctionArgs
ARN of the lambda function to add custom logging and analytics for authenticated sessions.
triggers.postConfirmation?
Type string
|
FunctionArgs
ARN of the lambda function to customize welcome messages and log events for custom analytics.
triggers.preAuthentication?
Type string
|
FunctionArgs
ARN of the lambda function to modify or deny sign-in with custom logic.
triggers.preSignUp?
Type string
|
FunctionArgs
ARN of the lambda function to validate users when they sign up and customize their attributes.
triggers.preTokenGenerationConfig?
Type string
|
FunctionArgs
ARN of the lambda function to modify claims in ID and access tokens.
triggers.userMigration?
Type string
|
FunctionArgs
ARN of the lambda function to migrate a user from another directory when they sign in to your user pool.
triggers.verifyAuthChallengeResponse?
Type string
|
FunctionArgs
ARN of the lambda function to compare user answer to expected answer for a custom challenge.
usernames?
Type Input
<
Input
<
“
email
”
|
“
phone
”
>
[]
>
Default User can only sign in with their username.
Allow users to be able to sign up and sign in with an email addresses or phone number as their username.
Properties
id
Type Output
<
string
>
The Cognito user pool ID.
nodes
nodes.userPool
Type UserPool
The Amazon Cognito user pool.
SDK
The following are accessible through the SDK at runtime.
id
Type string
The Cognito user pool ID.
Methods
addClient
Parameters
Name of the client.name
string
- Configure the client.
Returns CognitoUserPoolClient
Add a client to the user pool.
CognitoUserPoolClientArgs
transform?
transform.client?
Type UserPoolClientArgs
|
(
args
:
UserPoolClientArgs
=>
void
)
Transform the Cognito user pool client resource.