UNPKG

@pulumi/aws

Version:

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

207 lines • 7.6 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.Directory = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Simple or Managed Microsoft directory in AWS Directory Service. * * ## Example Usage * * ### SimpleAD * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"}); * const foo = new aws.ec2.Subnet("foo", { * vpcId: main.id, * availabilityZone: "us-west-2a", * cidrBlock: "10.0.1.0/24", * }); * const barSubnet = new aws.ec2.Subnet("bar", { * vpcId: main.id, * availabilityZone: "us-west-2b", * cidrBlock: "10.0.2.0/24", * }); * const bar = new aws.directoryservice.Directory("bar", { * name: "corp.notexample.com", * password: "SuperSecretPassw0rd", * size: "Small", * vpcSettings: { * vpcId: main.id, * subnetIds: [ * foo.id, * barSubnet.id, * ], * }, * tags: { * Project: "foo", * }, * }); * ``` * * ### Microsoft Active Directory (MicrosoftAD) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"}); * const foo = new aws.ec2.Subnet("foo", { * vpcId: main.id, * availabilityZone: "us-west-2a", * cidrBlock: "10.0.1.0/24", * }); * const barSubnet = new aws.ec2.Subnet("bar", { * vpcId: main.id, * availabilityZone: "us-west-2b", * cidrBlock: "10.0.2.0/24", * }); * const bar = new aws.directoryservice.Directory("bar", { * name: "corp.notexample.com", * password: "SuperSecretPassw0rd", * edition: "Standard", * type: "MicrosoftAD", * vpcSettings: { * vpcId: main.id, * subnetIds: [ * foo.id, * barSubnet.id, * ], * }, * tags: { * Project: "foo", * }, * }); * ``` * * ### Microsoft Active Directory Connector (ADConnector) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"}); * const foo = new aws.ec2.Subnet("foo", { * vpcId: main.id, * availabilityZone: "us-west-2a", * cidrBlock: "10.0.1.0/24", * }); * const bar = new aws.ec2.Subnet("bar", { * vpcId: main.id, * availabilityZone: "us-west-2b", * cidrBlock: "10.0.2.0/24", * }); * const connector = new aws.directoryservice.Directory("connector", { * name: "corp.notexample.com", * password: "SuperSecretPassw0rd", * size: "Small", * type: "ADConnector", * connectSettings: { * customerDnsIps: ["A.B.C.D"], * customerUsername: "Admin", * subnetIds: [ * foo.id, * bar.id, * ], * vpcId: main.id, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import DirectoryService directories using the directory `id`. For example: * * ```sh * $ pulumi import aws:directoryservice/directory:Directory sample d-926724cf57 * ``` */ class Directory extends pulumi.CustomResource { /** * Get an existing Directory 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 Directory(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Directory. 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'] === Directory.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessUrl"] = state?.accessUrl; resourceInputs["alias"] = state?.alias; resourceInputs["connectSettings"] = state?.connectSettings; resourceInputs["description"] = state?.description; resourceInputs["desiredNumberOfDomainControllers"] = state?.desiredNumberOfDomainControllers; resourceInputs["dnsIpAddresses"] = state?.dnsIpAddresses; resourceInputs["edition"] = state?.edition; resourceInputs["enableSso"] = state?.enableSso; resourceInputs["name"] = state?.name; resourceInputs["password"] = state?.password; resourceInputs["region"] = state?.region; resourceInputs["securityGroupId"] = state?.securityGroupId; resourceInputs["shortName"] = state?.shortName; resourceInputs["size"] = state?.size; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["type"] = state?.type; resourceInputs["vpcSettings"] = state?.vpcSettings; } else { const args = argsOrState; if (args?.name === undefined && !opts.urn) { throw new Error("Missing required property 'name'"); } if (args?.password === undefined && !opts.urn) { throw new Error("Missing required property 'password'"); } resourceInputs["alias"] = args?.alias; resourceInputs["connectSettings"] = args?.connectSettings; resourceInputs["description"] = args?.description; resourceInputs["desiredNumberOfDomainControllers"] = args?.desiredNumberOfDomainControllers; resourceInputs["edition"] = args?.edition; resourceInputs["enableSso"] = args?.enableSso; resourceInputs["name"] = args?.name; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["region"] = args?.region; resourceInputs["shortName"] = args?.shortName; resourceInputs["size"] = args?.size; resourceInputs["tags"] = args?.tags; resourceInputs["type"] = args?.type; resourceInputs["vpcSettings"] = args?.vpcSettings; resourceInputs["accessUrl"] = undefined /*out*/; resourceInputs["dnsIpAddresses"] = undefined /*out*/; resourceInputs["securityGroupId"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Directory.__pulumiType, name, resourceInputs, opts); } } exports.Directory = Directory; /** @internal */ Directory.__pulumiType = 'aws:directoryservice/directory:Directory'; //# sourceMappingURL=directory.js.map