@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
166 lines • 7.26 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.Trust = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a trust relationship between two Active Directory Directories.
*
* The directories may either be both AWS Managed Microsoft AD domains or an AWS Managed Microsoft AD domain and a self-managed Active Directory Domain.
*
* The Trust relationship must be configured on both sides of the relationship.
* If a Trust has only been created on one side, it will be in the state `VerifyFailed`.
* Once the second Trust is created, the first will update to the correct state.
*
* ## Example Usage
*
* ### Two-Way Trust
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const oneDirectory = new aws.directoryservice.Directory("one", {
* name: "one.example.com",
* type: "MicrosoftAD",
* });
* const twoDirectory = new aws.directoryservice.Directory("two", {
* name: "two.example.com",
* type: "MicrosoftAD",
* });
* const one = new aws.directoryservice.Trust("one", {
* directoryId: oneDirectory.id,
* remoteDomainName: twoDirectory.name,
* trustDirection: "Two-Way",
* trustPassword: "Some0therPassword",
* conditionalForwarderIpAddrs: twoDirectory.dnsIpAddresses,
* });
* const two = new aws.directoryservice.Trust("two", {
* directoryId: twoDirectory.id,
* remoteDomainName: oneDirectory.name,
* trustDirection: "Two-Way",
* trustPassword: "Some0therPassword",
* conditionalForwarderIpAddrs: oneDirectory.dnsIpAddresses,
* });
* ```
*
* ### One-Way Trust
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const oneDirectory = new aws.directoryservice.Directory("one", {
* name: "one.example.com",
* type: "MicrosoftAD",
* });
* const twoDirectory = new aws.directoryservice.Directory("two", {
* name: "two.example.com",
* type: "MicrosoftAD",
* });
* const one = new aws.directoryservice.Trust("one", {
* directoryId: oneDirectory.id,
* remoteDomainName: twoDirectory.name,
* trustDirection: "One-Way: Incoming",
* trustPassword: "Some0therPassword",
* conditionalForwarderIpAddrs: twoDirectory.dnsIpAddresses,
* });
* const two = new aws.directoryservice.Trust("two", {
* directoryId: twoDirectory.id,
* remoteDomainName: oneDirectory.name,
* trustDirection: "One-Way: Outgoing",
* trustPassword: "Some0therPassword",
* conditionalForwarderIpAddrs: oneDirectory.dnsIpAddresses,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import the Trust relationship using the directory ID and remote domain name, separated by a `/`. For example:
*
* ```sh
* $ pulumi import aws:directoryservice/trust:Trust example d-926724cf57/directory.example.com
* ```
*/
class Trust extends pulumi.CustomResource {
/**
* Get an existing Trust 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 Trust(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Trust. 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'] === Trust.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["conditionalForwarderIpAddrs"] = state?.conditionalForwarderIpAddrs;
resourceInputs["createdDateTime"] = state?.createdDateTime;
resourceInputs["deleteAssociatedConditionalForwarder"] = state?.deleteAssociatedConditionalForwarder;
resourceInputs["directoryId"] = state?.directoryId;
resourceInputs["lastUpdatedDateTime"] = state?.lastUpdatedDateTime;
resourceInputs["region"] = state?.region;
resourceInputs["remoteDomainName"] = state?.remoteDomainName;
resourceInputs["selectiveAuth"] = state?.selectiveAuth;
resourceInputs["stateLastUpdatedDateTime"] = state?.stateLastUpdatedDateTime;
resourceInputs["trustDirection"] = state?.trustDirection;
resourceInputs["trustPassword"] = state?.trustPassword;
resourceInputs["trustState"] = state?.trustState;
resourceInputs["trustStateReason"] = state?.trustStateReason;
resourceInputs["trustType"] = state?.trustType;
}
else {
const args = argsOrState;
if (args?.directoryId === undefined && !opts.urn) {
throw new Error("Missing required property 'directoryId'");
}
if (args?.remoteDomainName === undefined && !opts.urn) {
throw new Error("Missing required property 'remoteDomainName'");
}
if (args?.trustDirection === undefined && !opts.urn) {
throw new Error("Missing required property 'trustDirection'");
}
if (args?.trustPassword === undefined && !opts.urn) {
throw new Error("Missing required property 'trustPassword'");
}
resourceInputs["conditionalForwarderIpAddrs"] = args?.conditionalForwarderIpAddrs;
resourceInputs["deleteAssociatedConditionalForwarder"] = args?.deleteAssociatedConditionalForwarder;
resourceInputs["directoryId"] = args?.directoryId;
resourceInputs["region"] = args?.region;
resourceInputs["remoteDomainName"] = args?.remoteDomainName;
resourceInputs["selectiveAuth"] = args?.selectiveAuth;
resourceInputs["trustDirection"] = args?.trustDirection;
resourceInputs["trustPassword"] = args?.trustPassword;
resourceInputs["trustType"] = args?.trustType;
resourceInputs["createdDateTime"] = undefined /*out*/;
resourceInputs["lastUpdatedDateTime"] = undefined /*out*/;
resourceInputs["stateLastUpdatedDateTime"] = undefined /*out*/;
resourceInputs["trustState"] = undefined /*out*/;
resourceInputs["trustStateReason"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Trust.__pulumiType, name, resourceInputs, opts);
}
}
exports.Trust = Trust;
/** @internal */
Trust.__pulumiType = 'aws:directoryservice/trust:Trust';
//# sourceMappingURL=trust.js.map