UNPKG

@pulumi/aws

Version:

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

128 lines 5.22 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.UserPoolDomain = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Cognito User Pool Domain resource. * * ## Example Usage * * ### Amazon Cognito domain * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cognito.UserPool("example", {name: "example-pool"}); * const main = new aws.cognito.UserPoolDomain("main", { * domain: "example-domain", * userPoolId: example.id, * }); * ``` * * ### Custom Cognito domain * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const exampleUserPool = new aws.cognito.UserPool("example", {name: "example-pool"}); * const main = new aws.cognito.UserPoolDomain("main", { * domain: "auth.example.com", * certificateArn: cert.arn, * userPoolId: exampleUserPool.id, * }); * const example = aws.route53.getZone({ * name: "example.com", * }); * const auth_cognito_A = new aws.route53.Record("auth-cognito-A", { * name: main.domain, * type: aws.route53.RecordType.A, * zoneId: example.then(example => example.zoneId), * aliases: [{ * evaluateTargetHealth: false, * name: main.cloudfrontDistribution, * zoneId: main.cloudfrontDistributionZoneId, * }], * }); * ``` * * ## Import * * Using `pulumi import`, import Cognito User Pool Domains using the `domain`. For example: * * ```sh * $ pulumi import aws:cognito/userPoolDomain:UserPoolDomain main auth.example.org * ``` */ class UserPoolDomain extends pulumi.CustomResource { /** * Get an existing UserPoolDomain 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 UserPoolDomain(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of UserPoolDomain. 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'] === UserPoolDomain.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["awsAccountId"] = state?.awsAccountId; resourceInputs["certificateArn"] = state?.certificateArn; resourceInputs["cloudfrontDistribution"] = state?.cloudfrontDistribution; resourceInputs["cloudfrontDistributionArn"] = state?.cloudfrontDistributionArn; resourceInputs["cloudfrontDistributionZoneId"] = state?.cloudfrontDistributionZoneId; resourceInputs["domain"] = state?.domain; resourceInputs["managedLoginVersion"] = state?.managedLoginVersion; resourceInputs["region"] = state?.region; resourceInputs["s3Bucket"] = state?.s3Bucket; resourceInputs["userPoolId"] = state?.userPoolId; resourceInputs["version"] = state?.version; } else { const args = argsOrState; if (args?.domain === undefined && !opts.urn) { throw new Error("Missing required property 'domain'"); } if (args?.userPoolId === undefined && !opts.urn) { throw new Error("Missing required property 'userPoolId'"); } resourceInputs["certificateArn"] = args?.certificateArn; resourceInputs["domain"] = args?.domain; resourceInputs["managedLoginVersion"] = args?.managedLoginVersion; resourceInputs["region"] = args?.region; resourceInputs["userPoolId"] = args?.userPoolId; resourceInputs["awsAccountId"] = undefined /*out*/; resourceInputs["cloudfrontDistribution"] = undefined /*out*/; resourceInputs["cloudfrontDistributionArn"] = undefined /*out*/; resourceInputs["cloudfrontDistributionZoneId"] = undefined /*out*/; resourceInputs["s3Bucket"] = undefined /*out*/; resourceInputs["version"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(UserPoolDomain.__pulumiType, name, resourceInputs, opts); } } exports.UserPoolDomain = UserPoolDomain; /** @internal */ UserPoolDomain.__pulumiType = 'aws:cognito/userPoolDomain:UserPoolDomain'; //# sourceMappingURL=userPoolDomain.js.map