@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
207 lines • 8.27 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.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, Object.assign(Object.assign({}, 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 ? state.accessUrl : undefined;
resourceInputs["alias"] = state ? state.alias : undefined;
resourceInputs["connectSettings"] = state ? state.connectSettings : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["desiredNumberOfDomainControllers"] = state ? state.desiredNumberOfDomainControllers : undefined;
resourceInputs["dnsIpAddresses"] = state ? state.dnsIpAddresses : undefined;
resourceInputs["edition"] = state ? state.edition : undefined;
resourceInputs["enableSso"] = state ? state.enableSso : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined;
resourceInputs["shortName"] = state ? state.shortName : undefined;
resourceInputs["size"] = state ? state.size : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["vpcSettings"] = state ? state.vpcSettings : undefined;
}
else {
const args = argsOrState;
if ((!args || args.name === undefined) && !opts.urn) {
throw new Error("Missing required property 'name'");
}
if ((!args || args.password === undefined) && !opts.urn) {
throw new Error("Missing required property 'password'");
}
resourceInputs["alias"] = args ? args.alias : undefined;
resourceInputs["connectSettings"] = args ? args.connectSettings : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["desiredNumberOfDomainControllers"] = args ? args.desiredNumberOfDomainControllers : undefined;
resourceInputs["edition"] = args ? args.edition : undefined;
resourceInputs["enableSso"] = args ? args.enableSso : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["shortName"] = args ? args.shortName : undefined;
resourceInputs["size"] = args ? args.size : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["vpcSettings"] = args ? args.vpcSettings : undefined;
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