@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
128 lines • 5.58 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.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, Object.assign(Object.assign({}, 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 ? state.awsAccountId : undefined;
resourceInputs["certificateArn"] = state ? state.certificateArn : undefined;
resourceInputs["cloudfrontDistribution"] = state ? state.cloudfrontDistribution : undefined;
resourceInputs["cloudfrontDistributionArn"] = state ? state.cloudfrontDistributionArn : undefined;
resourceInputs["cloudfrontDistributionZoneId"] = state ? state.cloudfrontDistributionZoneId : undefined;
resourceInputs["domain"] = state ? state.domain : undefined;
resourceInputs["managedLoginVersion"] = state ? state.managedLoginVersion : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["s3Bucket"] = state ? state.s3Bucket : undefined;
resourceInputs["userPoolId"] = state ? state.userPoolId : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.domain === undefined) && !opts.urn) {
throw new Error("Missing required property 'domain'");
}
if ((!args || args.userPoolId === undefined) && !opts.urn) {
throw new Error("Missing required property 'userPoolId'");
}
resourceInputs["certificateArn"] = args ? args.certificateArn : undefined;
resourceInputs["domain"] = args ? args.domain : undefined;
resourceInputs["managedLoginVersion"] = args ? args.managedLoginVersion : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["userPoolId"] = args ? args.userPoolId : undefined;
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