@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
186 lines • 8.9 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserPool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Cognito User Pool resource.
*
* ## Example Usage
*
* ### Basic configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const pool = new aws.cognito.UserPool("pool", {name: "mypool"});
* ```
*
* ### Enabling SMS and Software Token Multi-Factor Authentication
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.cognito.UserPool("example", {
* mfaConfiguration: "ON",
* smsAuthenticationMessage: "Your code is {####}",
* smsConfiguration: {
* externalId: "example",
* snsCallerArn: exampleAwsIamRole.arn,
* snsRegion: "us-east-1",
* },
* softwareTokenMfaConfiguration: {
* enabled: true,
* },
* });
* ```
*
* ### Using Account Recovery Setting
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.cognito.UserPool("test", {
* name: "mypool",
* accountRecoverySetting: {
* recoveryMechanisms: [
* {
* name: "verified_email",
* priority: 1,
* },
* {
* name: "verified_phone_number",
* priority: 2,
* },
* ],
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Cognito User Pools using the `id`. For example:
*
* ```sh
* $ pulumi import aws:cognito/userPool:UserPool pool us-west-2_abc123
* ```
*/
class UserPool extends pulumi.CustomResource {
/**
* Get an existing UserPool resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new UserPool(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of UserPool. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === UserPool.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountRecoverySetting"] = state?.accountRecoverySetting;
resourceInputs["adminCreateUserConfig"] = state?.adminCreateUserConfig;
resourceInputs["aliasAttributes"] = state?.aliasAttributes;
resourceInputs["arn"] = state?.arn;
resourceInputs["autoVerifiedAttributes"] = state?.autoVerifiedAttributes;
resourceInputs["creationDate"] = state?.creationDate;
resourceInputs["customDomain"] = state?.customDomain;
resourceInputs["deletionProtection"] = state?.deletionProtection;
resourceInputs["deviceConfiguration"] = state?.deviceConfiguration;
resourceInputs["domain"] = state?.domain;
resourceInputs["emailConfiguration"] = state?.emailConfiguration;
resourceInputs["emailMfaConfiguration"] = state?.emailMfaConfiguration;
resourceInputs["emailVerificationMessage"] = state?.emailVerificationMessage;
resourceInputs["emailVerificationSubject"] = state?.emailVerificationSubject;
resourceInputs["endpoint"] = state?.endpoint;
resourceInputs["estimatedNumberOfUsers"] = state?.estimatedNumberOfUsers;
resourceInputs["lambdaConfig"] = state?.lambdaConfig;
resourceInputs["lastModifiedDate"] = state?.lastModifiedDate;
resourceInputs["mfaConfiguration"] = state?.mfaConfiguration;
resourceInputs["name"] = state?.name;
resourceInputs["passwordPolicy"] = state?.passwordPolicy;
resourceInputs["region"] = state?.region;
resourceInputs["schemas"] = state?.schemas;
resourceInputs["signInPolicy"] = state?.signInPolicy;
resourceInputs["smsAuthenticationMessage"] = state?.smsAuthenticationMessage;
resourceInputs["smsConfiguration"] = state?.smsConfiguration;
resourceInputs["smsVerificationMessage"] = state?.smsVerificationMessage;
resourceInputs["softwareTokenMfaConfiguration"] = state?.softwareTokenMfaConfiguration;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["userAttributeUpdateSettings"] = state?.userAttributeUpdateSettings;
resourceInputs["userPoolAddOns"] = state?.userPoolAddOns;
resourceInputs["userPoolTier"] = state?.userPoolTier;
resourceInputs["usernameAttributes"] = state?.usernameAttributes;
resourceInputs["usernameConfiguration"] = state?.usernameConfiguration;
resourceInputs["verificationMessageTemplate"] = state?.verificationMessageTemplate;
resourceInputs["webAuthnConfiguration"] = state?.webAuthnConfiguration;
}
else {
const args = argsOrState;
resourceInputs["accountRecoverySetting"] = args?.accountRecoverySetting;
resourceInputs["adminCreateUserConfig"] = args?.adminCreateUserConfig;
resourceInputs["aliasAttributes"] = args?.aliasAttributes;
resourceInputs["autoVerifiedAttributes"] = args?.autoVerifiedAttributes;
resourceInputs["deletionProtection"] = args?.deletionProtection;
resourceInputs["deviceConfiguration"] = args?.deviceConfiguration;
resourceInputs["emailConfiguration"] = args?.emailConfiguration;
resourceInputs["emailMfaConfiguration"] = args?.emailMfaConfiguration;
resourceInputs["emailVerificationMessage"] = args?.emailVerificationMessage;
resourceInputs["emailVerificationSubject"] = args?.emailVerificationSubject;
resourceInputs["lambdaConfig"] = args?.lambdaConfig;
resourceInputs["mfaConfiguration"] = args?.mfaConfiguration;
resourceInputs["name"] = args?.name;
resourceInputs["passwordPolicy"] = args?.passwordPolicy;
resourceInputs["region"] = args?.region;
resourceInputs["schemas"] = args?.schemas;
resourceInputs["signInPolicy"] = args?.signInPolicy;
resourceInputs["smsAuthenticationMessage"] = args?.smsAuthenticationMessage;
resourceInputs["smsConfiguration"] = args?.smsConfiguration;
resourceInputs["smsVerificationMessage"] = args?.smsVerificationMessage;
resourceInputs["softwareTokenMfaConfiguration"] = args?.softwareTokenMfaConfiguration;
resourceInputs["tags"] = args?.tags;
resourceInputs["userAttributeUpdateSettings"] = args?.userAttributeUpdateSettings;
resourceInputs["userPoolAddOns"] = args?.userPoolAddOns;
resourceInputs["userPoolTier"] = args?.userPoolTier;
resourceInputs["usernameAttributes"] = args?.usernameAttributes;
resourceInputs["usernameConfiguration"] = args?.usernameConfiguration;
resourceInputs["verificationMessageTemplate"] = args?.verificationMessageTemplate;
resourceInputs["webAuthnConfiguration"] = args?.webAuthnConfiguration;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["creationDate"] = undefined /*out*/;
resourceInputs["customDomain"] = undefined /*out*/;
resourceInputs["domain"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["estimatedNumberOfUsers"] = undefined /*out*/;
resourceInputs["lastModifiedDate"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(UserPool.__pulumiType, name, resourceInputs, opts);
}
}
exports.UserPool = UserPool;
/** @internal */
UserPool.__pulumiType = 'aws:cognito/userPool:UserPool';
//# sourceMappingURL=userPool.js.map