interface PasswordPolicy
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Cognito.PasswordPolicy |
Java | software.amazon.awscdk.services.cognito.PasswordPolicy |
Python | aws_cdk.aws_cognito.PasswordPolicy |
TypeScript (source) | @aws-cdk/aws-cognito » PasswordPolicy |
Password policy for User Pools.
Example
new cognito.UserPool(this, 'myuserpool', {
// ...
passwordPolicy: {
minLength: 12,
requireLowercase: true,
requireUppercase: true,
requireDigits: true,
requireSymbols: true,
tempPasswordValidity: Duration.days(3),
},
});
Properties
| Name | Type | Description |
|---|---|---|
| min | number | Minimum length required for a user's password. |
| require | boolean | Whether the user is required to have digits in their password. |
| require | boolean | Whether the user is required to have lowercase characters in their password. |
| require | boolean | Whether the user is required to have symbols in their password. |
| require | boolean | Whether the user is required to have uppercase characters in their password. |
| temp | Duration | The length of time the temporary password generated by an admin is valid. |
minLength?
Type:
number
(optional, default: 8)
Minimum length required for a user's password.
requireDigits?
Type:
boolean
(optional, default: true)
Whether the user is required to have digits in their password.
requireLowercase?
Type:
boolean
(optional, default: true)
Whether the user is required to have lowercase characters in their password.
requireSymbols?
Type:
boolean
(optional, default: true)
Whether the user is required to have symbols in their password.
requireUppercase?
Type:
boolean
(optional, default: true)
Whether the user is required to have uppercase characters in their password.
tempPasswordValidity?
Type:
Duration
(optional, default: Duration.days(7))
The length of time the temporary password generated by an admin is valid.
This must be provided as whole days, like Duration.days(3) or Duration.hours(48). Fractional days, such as Duration.hours(20), will generate an error.

.NET
Java
Python
TypeScript (