UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

186 lines • 10.2 kB
"use strict"; // *** 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, Object.assign(Object.assign({}, 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 ? state.accountRecoverySetting : undefined; resourceInputs["adminCreateUserConfig"] = state ? state.adminCreateUserConfig : undefined; resourceInputs["aliasAttributes"] = state ? state.aliasAttributes : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["autoVerifiedAttributes"] = state ? state.autoVerifiedAttributes : undefined; resourceInputs["creationDate"] = state ? state.creationDate : undefined; resourceInputs["customDomain"] = state ? state.customDomain : undefined; resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined; resourceInputs["deviceConfiguration"] = state ? state.deviceConfiguration : undefined; resourceInputs["domain"] = state ? state.domain : undefined; resourceInputs["emailConfiguration"] = state ? state.emailConfiguration : undefined; resourceInputs["emailMfaConfiguration"] = state ? state.emailMfaConfiguration : undefined; resourceInputs["emailVerificationMessage"] = state ? state.emailVerificationMessage : undefined; resourceInputs["emailVerificationSubject"] = state ? state.emailVerificationSubject : undefined; resourceInputs["endpoint"] = state ? state.endpoint : undefined; resourceInputs["estimatedNumberOfUsers"] = state ? state.estimatedNumberOfUsers : undefined; resourceInputs["lambdaConfig"] = state ? state.lambdaConfig : undefined; resourceInputs["lastModifiedDate"] = state ? state.lastModifiedDate : undefined; resourceInputs["mfaConfiguration"] = state ? state.mfaConfiguration : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["passwordPolicy"] = state ? state.passwordPolicy : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["schemas"] = state ? state.schemas : undefined; resourceInputs["signInPolicy"] = state ? state.signInPolicy : undefined; resourceInputs["smsAuthenticationMessage"] = state ? state.smsAuthenticationMessage : undefined; resourceInputs["smsConfiguration"] = state ? state.smsConfiguration : undefined; resourceInputs["smsVerificationMessage"] = state ? state.smsVerificationMessage : undefined; resourceInputs["softwareTokenMfaConfiguration"] = state ? state.softwareTokenMfaConfiguration : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["userAttributeUpdateSettings"] = state ? state.userAttributeUpdateSettings : undefined; resourceInputs["userPoolAddOns"] = state ? state.userPoolAddOns : undefined; resourceInputs["userPoolTier"] = state ? state.userPoolTier : undefined; resourceInputs["usernameAttributes"] = state ? state.usernameAttributes : undefined; resourceInputs["usernameConfiguration"] = state ? state.usernameConfiguration : undefined; resourceInputs["verificationMessageTemplate"] = state ? state.verificationMessageTemplate : undefined; resourceInputs["webAuthnConfiguration"] = state ? state.webAuthnConfiguration : undefined; } else { const args = argsOrState; resourceInputs["accountRecoverySetting"] = args ? args.accountRecoverySetting : undefined; resourceInputs["adminCreateUserConfig"] = args ? args.adminCreateUserConfig : undefined; resourceInputs["aliasAttributes"] = args ? args.aliasAttributes : undefined; resourceInputs["autoVerifiedAttributes"] = args ? args.autoVerifiedAttributes : undefined; resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined; resourceInputs["deviceConfiguration"] = args ? args.deviceConfiguration : undefined; resourceInputs["emailConfiguration"] = args ? args.emailConfiguration : undefined; resourceInputs["emailMfaConfiguration"] = args ? args.emailMfaConfiguration : undefined; resourceInputs["emailVerificationMessage"] = args ? args.emailVerificationMessage : undefined; resourceInputs["emailVerificationSubject"] = args ? args.emailVerificationSubject : undefined; resourceInputs["lambdaConfig"] = args ? args.lambdaConfig : undefined; resourceInputs["mfaConfiguration"] = args ? args.mfaConfiguration : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["passwordPolicy"] = args ? args.passwordPolicy : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["schemas"] = args ? args.schemas : undefined; resourceInputs["signInPolicy"] = args ? args.signInPolicy : undefined; resourceInputs["smsAuthenticationMessage"] = args ? args.smsAuthenticationMessage : undefined; resourceInputs["smsConfiguration"] = args ? args.smsConfiguration : undefined; resourceInputs["smsVerificationMessage"] = args ? args.smsVerificationMessage : undefined; resourceInputs["softwareTokenMfaConfiguration"] = args ? args.softwareTokenMfaConfiguration : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["userAttributeUpdateSettings"] = args ? args.userAttributeUpdateSettings : undefined; resourceInputs["userPoolAddOns"] = args ? args.userPoolAddOns : undefined; resourceInputs["userPoolTier"] = args ? args.userPoolTier : undefined; resourceInputs["usernameAttributes"] = args ? args.usernameAttributes : undefined; resourceInputs["usernameConfiguration"] = args ? args.usernameConfiguration : undefined; resourceInputs["verificationMessageTemplate"] = args ? args.verificationMessageTemplate : undefined; resourceInputs["webAuthnConfiguration"] = args ? args.webAuthnConfiguration : undefined; 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