Skip to content
v2.278.0

AccountRecoverySettingProperty Struct ​

The available verified method a user can use to recover their password when they call ForgotPassword .

You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn't qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred through email.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cognito as cognito } from 'aws-cdk-lib';
const accountRecoverySettingProperty: cognito.CfnUserPool.AccountRecoverySettingProperty = {
  recoveryMechanisms: [{
    name: 'name',
    priority: 123,
  }],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cognito as cognito

account_recovery_setting_property = cognito.CfnUserPool.AccountRecoverySettingProperty(
    recovery_mechanisms=[cognito.CfnUserPool.RecoveryOptionProperty(
        name="name",
        priority=123
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cognito.*;

AccountRecoverySettingProperty accountRecoverySettingProperty = AccountRecoverySettingProperty.builder()
        .recoveryMechanisms(List.of(RecoveryOptionProperty.builder()
                .name("name")
                .priority(123)
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Cognito;

var accountRecoverySettingProperty = new AccountRecoverySettingProperty {
    RecoveryMechanisms = new [] { new RecoveryOptionProperty {
        Name = "name",
        Priority = 123
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

accountRecoverySettingProperty := &AccountRecoverySettingProperty{
	RecoveryMechanisms: []interface{}{
		&RecoveryOptionProperty{
			Name: jsii.String("name"),
			Priority: jsii.Number(123),
		},
	},
}

Properties ​

recoveryMechanismsoptionalIResolvable | IResolvable | CfnUserPool.RecoveryOptionProperty[]recovery_mechanismsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, RecoveryOptionProperty]]]recoveryMechanismsoptionalIResolvableRecoveryMechanismsoptionalIResolvableRecoveryMechanismsoptionalinterface{} #
The list of options and priorities for user message delivery in forgot-password operations.

Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators.