@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
166 lines • 7.76 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, Object.assign(Object.assign({}, 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 ? state.conditionalForwarderIpAddrs : undefined;
resourceInputs["createdDateTime"] = state ? state.createdDateTime : undefined;
resourceInputs["deleteAssociatedConditionalForwarder"] = state ? state.deleteAssociatedConditionalForwarder : undefined;
resourceInputs["directoryId"] = state ? state.directoryId : undefined;
resourceInputs["lastUpdatedDateTime"] = state ? state.lastUpdatedDateTime : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["remoteDomainName"] = state ? state.remoteDomainName : undefined;
resourceInputs["selectiveAuth"] = state ? state.selectiveAuth : undefined;
resourceInputs["stateLastUpdatedDateTime"] = state ? state.stateLastUpdatedDateTime : undefined;
resourceInputs["trustDirection"] = state ? state.trustDirection : undefined;
resourceInputs["trustPassword"] = state ? state.trustPassword : undefined;
resourceInputs["trustState"] = state ? state.trustState : undefined;
resourceInputs["trustStateReason"] = state ? state.trustStateReason : undefined;
resourceInputs["trustType"] = state ? state.trustType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.directoryId === undefined) && !opts.urn) {
throw new Error("Missing required property 'directoryId'");
}
if ((!args || args.remoteDomainName === undefined) && !opts.urn) {
throw new Error("Missing required property 'remoteDomainName'");
}
if ((!args || args.trustDirection === undefined) && !opts.urn) {
throw new Error("Missing required property 'trustDirection'");
}
if ((!args || args.trustPassword === undefined) && !opts.urn) {
throw new Error("Missing required property 'trustPassword'");
}
resourceInputs["conditionalForwarderIpAddrs"] = args ? args.conditionalForwarderIpAddrs : undefined;
resourceInputs["deleteAssociatedConditionalForwarder"] = args ? args.deleteAssociatedConditionalForwarder : undefined;
resourceInputs["directoryId"] = args ? args.directoryId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["remoteDomainName"] = args ? args.remoteDomainName : undefined;
resourceInputs["selectiveAuth"] = args ? args.selectiveAuth : undefined;
resourceInputs["trustDirection"] = args ? args.trustDirection : undefined;
resourceInputs["trustPassword"] = args ? args.trustPassword : undefined;
resourceInputs["trustType"] = args ? args.trustType : undefined;
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