UserPool

class UserPool : KotlinCustomResource

Provides a Cognito User Pool resource.

Example Usage

Basic configuration

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cognito.UserPool;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var pool = new UserPool("pool");
}
}

Enabling SMS and Software Token Multi-Factor Authentication

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cognito.UserPool;
import com.pulumi.aws.cognito.UserPoolArgs;
import com.pulumi.aws.cognito.inputs.UserPoolSmsConfigurationArgs;
import com.pulumi.aws.cognito.inputs.UserPoolSoftwareTokenMfaConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new UserPool("example", UserPoolArgs.builder()
.mfaConfiguration("ON")
.smsAuthenticationMessage("Your code is {####}")
.smsConfiguration(UserPoolSmsConfigurationArgs.builder()
.externalId("example")
.snsCallerArn(aws_iam_role.example().arn())
.snsRegion("us-east-1")
.build())
.softwareTokenMfaConfiguration(UserPoolSoftwareTokenMfaConfigurationArgs.builder()
.enabled(true)
.build())
.build());
}
}

Using Account Recovery Setting

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cognito.UserPool;
import com.pulumi.aws.cognito.UserPoolArgs;
import com.pulumi.aws.cognito.inputs.UserPoolAccountRecoverySettingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new UserPool("test", UserPoolArgs.builder()
.accountRecoverySetting(UserPoolAccountRecoverySettingArgs.builder()
.recoveryMechanisms(
UserPoolAccountRecoverySettingRecoveryMechanismArgs.builder()
.name("verified_email")
.priority(1)
.build(),
UserPoolAccountRecoverySettingRecoveryMechanismArgs.builder()
.name("verified_phone_number")
.priority(2)
.build())
.build())
.build());
}
}

Import

Cognito User Pools can be imported using the id, e.g.,

$ pulumi import aws:cognito/userPool:UserPool pool us-west-2_abc123

Properties

Link copied to clipboard

Configuration block to define which verified available method a user can use to recover their forgotten password. Detailed below.

Link copied to clipboard

Configuration block for creating a new user profile. Detailed below.

Link copied to clipboard
val aliasAttributes: Output<List<String>>?

Attributes supported as an alias for this user pool. Valid values: phone_number, email, or preferred_username. Conflicts with username_attributes.

Link copied to clipboard
val arn: Output<String>

ARN of the user pool.

Link copied to clipboard

Attributes to be auto-verified. Valid values: email, phone_number.

Link copied to clipboard
val creationDate: Output<String>

Date the user pool was created.

Link copied to clipboard
val customDomain: Output<String>

A custom domain name that you provide to Amazon Cognito. This parameter applies only if you use a custom domain to host the sign-up and sign-in pages for your application. For example: auth.example.com.

Link copied to clipboard

When active, DeletionProtection prevents accidental deletion of your user pool. Before you can delete a user pool that you have protected against deletion, you must deactivate this feature. Valid values are ACTIVE and INACTIVE, Default value is INACTIVE.

Link copied to clipboard

Configuration block for the user pool's device tracking. Detailed below.

Link copied to clipboard
val domain: Output<String>

Holds the domain prefix if the user pool has a domain associated with it.

Link copied to clipboard

Configuration block for configuring email. Detailed below.

Link copied to clipboard

String representing the email verification message. Conflicts with verification_message_template configuration block email_message argument.

Link copied to clipboard

String representing the email verification subject. Conflicts with verification_message_template configuration block email_subject argument.

Link copied to clipboard
val endpoint: Output<String>

Endpoint name of the user pool. Example format: cognito-idp.REGION.amazonaws.com/xxxx_yyyyy

Link copied to clipboard

A number estimating the size of the user pool.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Configuration block for the AWS Lambda triggers associated with the user pool. Detailed below.

Link copied to clipboard

Date the user pool was last modified.

Link copied to clipboard
val mfaConfiguration: Output<String>?

Multi-Factor Authentication (MFA) configuration for the User Pool. Defaults of OFF. Valid values are OFF (MFA Tokens are not required), ON (MFA is required for all users to sign in; requires at least one of sms_configuration or software_token_mfa_configuration to be configured), or OPTIONAL (MFA Will be required only for individual users who have MFA Enabled; requires at least one of sms_configuration or software_token_mfa_configuration to be configured).

Link copied to clipboard
val name: Output<String>

Name of the user pool. The following arguments are optional:

Link copied to clipboard

Configuration blocked for information about the user pool password policy. Detailed below.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val schemas: Output<List<UserPoolSchema>>?

Configuration block for the schema attributes of a user pool. Detailed below. Schema attributes from the standard attribute set only need to be specified if they are different from the default configuration. Attributes can be added, but not modified or removed. Maximum of 50 attributes.

Link copied to clipboard

String representing the SMS authentication message. The Message must contain the {####} placeholder, which will be replaced with the code.

Link copied to clipboard

Configuration block for Short Message Service (SMS) settings. Detailed below. These settings apply to SMS user verification and SMS Multi-Factor Authentication (MFA). Due to Cognito API restrictions, the SMS configuration cannot be removed without recreating the Cognito User Pool. For user data safety, this resource will ignore the removal of this configuration by disabling drift detection.

Link copied to clipboard

String representing the SMS verification message. Conflicts with verification_message_template configuration block sms_message argument.

Link copied to clipboard

Configuration block for software token Mult-Factor Authentication (MFA) settings. Detailed below.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Map of tags to assign to the User Pool. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

Configuration block for user attribute update settings. Detailed below.

Link copied to clipboard

Whether email addresses or phone numbers can be specified as usernames when a user signs up. Conflicts with alias_attributes.

Link copied to clipboard

Configuration block for username configuration. Detailed below.

Link copied to clipboard

Configuration block for user pool add-ons to enable user pool advanced security mode features. Detailed below.

Link copied to clipboard

Configuration block for verification message templates. Detailed below.