SharedDirectory class
Manages a directory in your account (directory owner) shared with another account (directory consumer).
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.directoryservice.Directory("example", {
vpcSettings: {
vpcId: exampleAwsVpc.id,
subnetIds: exampleAwsSubnet.map(__item => __item.id),
},
name: "tf-example",
password: "SuperSecretPassw0rd",
type: "MicrosoftAD",
edition: "Standard",
});
const exampleSharedDirectory = new aws.directoryservice.SharedDirectory("example", {
target: {
id: receiver.accountId,
},
directoryId: example.id,
notes: "You wanna have a catch?",
});
import pulumi
import pulumi_aws as aws
example = aws.directoryservice.Directory("example",
vpc_settings={
"vpc_id": example_aws_vpc["id"],
"subnet_ids": [__item["id"] for __item in example_aws_subnet],
},
name="tf-example",
password="SuperSecretPassw0rd",
type="MicrosoftAD",
edition="Standard")
example_shared_directory = aws.directoryservice.SharedDirectory("example",
target={
"id": receiver["accountId"],
},
directory_id=example.id,
notes="You wanna have a catch?")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.DirectoryService.Directory("example", new()
{
VpcSettings = new Aws.DirectoryService.Inputs.DirectoryVpcSettingsArgs
{
VpcId = exampleAwsVpc.Id,
SubnetIds = exampleAwsSubnet.Select(__item => __item.Id).ToList(),
},
Name = "tf-example",
Password = "SuperSecretPassw0rd",
Type = "MicrosoftAD",
Edition = "Standard",
});
var exampleSharedDirectory = new Aws.DirectoryService.SharedDirectory("example", new()
{
Target = new Aws.DirectoryService.Inputs.SharedDirectoryTargetArgs
{
Id = receiver.AccountId,
},
DirectoryId = example.Id,
Notes = "You wanna have a catch?",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/directoryservice"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := directoryservice.NewDirectory(ctx, "example", &directoryservice.DirectoryArgs{
VpcSettings: &directoryservice.DirectoryVpcSettingsArgs{
VpcId: pulumi.Any(exampleAwsVpc.Id),
SubnetIds: pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:3,17-39)),
},
Name: pulumi.String("tf-example"),
Password: pulumi.String("SuperSecretPassw0rd"),
Type: pulumi.String("MicrosoftAD"),
Edition: pulumi.String("Standard"),
})
if err != nil {
return err
}
_, err = directoryservice.NewSharedDirectory(ctx, "example", &directoryservice.SharedDirectoryArgs{
Target: &directoryservice.SharedDirectoryTargetArgs{
Id: pulumi.Any(receiver.AccountId),
},
DirectoryId: example.ID().ToIDOutput().ToStringOutput(),
Notes: pulumi.String("You wanna have a catch?"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_directoryservice_directory" "example" {
vpc_settings = {
vpc_id = exampleAwsVpc.id
subnet_ids = exampleAwsSubnet[*].id
}
name = "tf-example"
password = "SuperSecretPassw0rd"
type = "MicrosoftAD"
edition = "Standard"
}
resource "aws_directoryservice_shareddirectory" "example" {
target = {
id = receiver.accountId
}
directory_id = aws_directoryservice_directory.example.id
notes = "You wanna have a catch?"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.directoryservice.Directory;
import com.pulumi.aws.directoryservice.DirectoryArgs;
import com.pulumi.aws.directoryservice.inputs.DirectoryVpcSettingsArgs;
import com.pulumi.aws.directoryservice.SharedDirectory;
import com.pulumi.aws.directoryservice.SharedDirectoryArgs;
import com.pulumi.aws.directoryservice.inputs.SharedDirectoryTargetArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Directory("example", DirectoryArgs.builder()
.vpcSettings(DirectoryVpcSettingsArgs.builder()
.vpcId(exampleAwsVpc.id())
.subnetIds(exampleAwsSubnet.stream().map(element -> element.id()).collect(toList()))
.build())
.name("tf-example")
.password("SuperSecretPassw0rd")
.type("MicrosoftAD")
.edition("Standard")
.build());
var exampleSharedDirectory = new SharedDirectory("exampleSharedDirectory", SharedDirectoryArgs.builder()
.target(SharedDirectoryTargetArgs.builder()
.id(receiver.accountId())
.build())
.directoryId(example.id())
.notes("You wanna have a catch?")
.build());
}
}
Import
Using pulumi import, import Directory Service Shared Directories using the owner directory ID/shared directory ID. For example:
$ pulumi import aws:directoryservice/sharedDirectory:SharedDirectory example d-1234567890/d-9267633ece
Constructors
-
Creates a new SharedDirectory.
nameThe Pulumi resource name.argsArguments used to configure this SharedDirectory. The set of arguments for SharedDirectory.optionsResource options controlling this resource's behavior. - Creates a typed reference to an existing SharedDirectory resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
directoryId
↔ Output<
String> -
Identifier of the Managed Microsoft AD directory that you want to share with other accounts.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
method
↔ Output<
String?> -
Method used when sharing a directory. Valid values are
ORGANIZATIONSandHANDSHAKE. Default isHANDSHAKE.latefinal -
notes
↔ Output<
String?> -
Message sent by the directory owner to the directory consumer to help the directory consumer administrator determine whether to approve or reject the share invitation.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
latefinal
-
target
↔ Output<
SharedDirectoryTarget> -
Identifier for the directory consumer account with whom the directory is to be shared. See below.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {SharedDirectoryState? state, CustomResourceOptions? options}) → SharedDirectory -
Gets an existing SharedDirectory resource's state with the given
nameandid.