@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
103 lines • 4.2 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.SharedDirectory = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a directory in your account (directory owner) shared with another account (directory consumer).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.directoryservice.Directory("example", {
* name: "tf-example",
* password: "SuperSecretPassw0rd",
* type: "MicrosoftAD",
* edition: "Standard",
* vpcSettings: {
* vpcId: exampleAwsVpc.id,
* subnetIds: exampleAwsSubnet.map(__item => __item.id),
* },
* });
* const exampleSharedDirectory = new aws.directoryservice.SharedDirectory("example", {
* directoryId: example.id,
* notes: "You wanna have a catch?",
* target: {
* id: receiver.accountId,
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Directory Service Shared Directories using the owner directory ID/shared directory ID. For example:
*
* ```sh
* $ pulumi import aws:directoryservice/sharedDirectory:SharedDirectory example d-1234567890/d-9267633ece
* ```
*/
class SharedDirectory extends pulumi.CustomResource {
/**
* Get an existing SharedDirectory 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 SharedDirectory(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SharedDirectory. 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'] === SharedDirectory.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["directoryId"] = state?.directoryId;
resourceInputs["method"] = state?.method;
resourceInputs["notes"] = state?.notes;
resourceInputs["region"] = state?.region;
resourceInputs["sharedDirectoryId"] = state?.sharedDirectoryId;
resourceInputs["target"] = state?.target;
}
else {
const args = argsOrState;
if (args?.directoryId === undefined && !opts.urn) {
throw new Error("Missing required property 'directoryId'");
}
if (args?.target === undefined && !opts.urn) {
throw new Error("Missing required property 'target'");
}
resourceInputs["directoryId"] = args?.directoryId;
resourceInputs["method"] = args?.method;
resourceInputs["notes"] = args?.notes ? pulumi.secret(args.notes) : undefined;
resourceInputs["region"] = args?.region;
resourceInputs["target"] = args?.target;
resourceInputs["sharedDirectoryId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["notes"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(SharedDirectory.__pulumiType, name, resourceInputs, opts);
}
}
exports.SharedDirectory = SharedDirectory;
/** @internal */
SharedDirectory.__pulumiType = 'aws:directoryservice/sharedDirectory:SharedDirectory';
//# sourceMappingURL=sharedDirectory.js.map