SharedDirectory

Manages a directory in your account (directory owner) shared with another account (directory consumer).

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var exampleDirectory = new Aws.DirectoryService.Directory("exampleDirectory", new()
    {
        Name = "tf-example",
        Password = "SuperSecretPassw0rd",
        Type = "MicrosoftAD",
        Edition = "Standard",
        VpcSettings = new Aws.DirectoryService.Inputs.DirectoryVpcSettingsArgs
        {
            VpcId = aws_vpc.Example.Id,
            SubnetIds = aws_subnet.Example.Select(__item => __item.Id).ToList(),
        },
    });

    var exampleSharedDirectory = new Aws.DirectoryService.SharedDirectory("exampleSharedDirectory", new()
    {
        DirectoryId = exampleDirectory.Id,
        Notes = "You wanna have a catch?",
        Target = new Aws.DirectoryService.Inputs.SharedDirectoryTargetArgs
        {
            Id = data.Aws_caller_identity.Receiver.Account_id,
        },
    });

});

Coming soon!

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.List;
import java.util.ArrayList;
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 exampleDirectory = new Directory("exampleDirectory", DirectoryArgs.builder()        
            .name("tf-example")
            .password("SuperSecretPassw0rd")
            .type("MicrosoftAD")
            .edition("Standard")
            .vpcSettings(DirectoryVpcSettingsArgs.builder()
                .vpcId(aws_vpc.example().id())
                .subnetIds(aws_subnet.example().stream().map(element -> element.id()).collect(toList()))
                .build())
            .build());

        var exampleSharedDirectory = new SharedDirectory("exampleSharedDirectory", SharedDirectoryArgs.builder()        
            .directoryId(exampleDirectory.id())
            .notes("You wanna have a catch?")
            .target(SharedDirectoryTargetArgs.builder()
                .id(data.aws_caller_identity().receiver().account_id())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_directory = aws.directoryservice.Directory("exampleDirectory",
    name="tf-example",
    password="SuperSecretPassw0rd",
    type="MicrosoftAD",
    edition="Standard",
    vpc_settings=aws.directoryservice.DirectoryVpcSettingsArgs(
        vpc_id=aws_vpc["example"]["id"],
        subnet_ids=[__item["id"] for __item in aws_subnet["example"]],
    ))
example_shared_directory = aws.directoryservice.SharedDirectory("exampleSharedDirectory",
    directory_id=example_directory.id,
    notes="You wanna have a catch?",
    target=aws.directoryservice.SharedDirectoryTargetArgs(
        id=data["aws_caller_identity"]["receiver"]["account_id"],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleDirectory = new aws.directoryservice.Directory("exampleDirectory", {
    name: "tf-example",
    password: "SuperSecretPassw0rd",
    type: "MicrosoftAD",
    edition: "Standard",
    vpcSettings: {
        vpcId: aws_vpc.example.id,
        subnetIds: aws_subnet.example.map(__item => __item.id),
    },
});
const exampleSharedDirectory = new aws.directoryservice.SharedDirectory("exampleSharedDirectory", {
    directoryId: exampleDirectory.id,
    notes: "You wanna have a catch?",
    target: {
        id: data.aws_caller_identity.receiver.account_id,
    },
});

Coming soon!

Create SharedDirectory Resource

new SharedDirectory(name: string, args: SharedDirectoryArgs, opts?: CustomResourceOptions);
@overload
def SharedDirectory(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    directory_id: Optional[str] = None,
                    method: Optional[str] = None,
                    notes: Optional[str] = None,
                    target: Optional[SharedDirectoryTargetArgs] = None)
@overload
def SharedDirectory(resource_name: str,
                    args: SharedDirectoryArgs,
                    opts: Optional[ResourceOptions] = None)
func NewSharedDirectory(ctx *Context, name string, args SharedDirectoryArgs, opts ...ResourceOption) (*SharedDirectory, error)
public SharedDirectory(string name, SharedDirectoryArgs args, CustomResourceOptions? opts = null)
public SharedDirectory(String name, SharedDirectoryArgs args)
public SharedDirectory(String name, SharedDirectoryArgs args, CustomResourceOptions options)
type: aws:directoryservice:SharedDirectory
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SharedDirectoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SharedDirectoryArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SharedDirectoryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SharedDirectoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SharedDirectoryArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SharedDirectory Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The SharedDirectory resource accepts the following input properties:

DirectoryId string

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

Target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

Method string

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

Notes 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.

DirectoryId string

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

Target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

Method string

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

Notes 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.

directoryId String

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

method String

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

notes 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.

directoryId string

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

method string

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

notes 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.

directory_id str

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

method str

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

notes str

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.

directoryId String

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

target Property Map

Identifier for the directory consumer account with whom the directory is to be shared. See below.

method String

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

notes 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.

Outputs

All input properties are implicitly available as output properties. Additionally, the SharedDirectory resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

SharedDirectoryId string

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

Id string

The provider-assigned unique ID for this managed resource.

SharedDirectoryId string

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

id String

The provider-assigned unique ID for this managed resource.

sharedDirectoryId String

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

id string

The provider-assigned unique ID for this managed resource.

sharedDirectoryId string

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

id str

The provider-assigned unique ID for this managed resource.

shared_directory_id str

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

id String

The provider-assigned unique ID for this managed resource.

sharedDirectoryId String

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

Look up Existing SharedDirectory Resource

Get an existing SharedDirectory resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SharedDirectoryState, opts?: CustomResourceOptions): SharedDirectory
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        directory_id: Optional[str] = None,
        method: Optional[str] = None,
        notes: Optional[str] = None,
        shared_directory_id: Optional[str] = None,
        target: Optional[SharedDirectoryTargetArgs] = None) -> SharedDirectory
func GetSharedDirectory(ctx *Context, name string, id IDInput, state *SharedDirectoryState, opts ...ResourceOption) (*SharedDirectory, error)
public static SharedDirectory Get(string name, Input<string> id, SharedDirectoryState? state, CustomResourceOptions? opts = null)
public static SharedDirectory get(String name, Output<String> id, SharedDirectoryState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
DirectoryId string

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

Method string

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

Notes 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.

SharedDirectoryId string

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

Target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

DirectoryId string

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

Method string

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

Notes 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.

SharedDirectoryId string

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

Target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

directoryId String

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

method String

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

notes 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.

sharedDirectoryId String

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

directoryId string

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

method string

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

notes 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.

sharedDirectoryId string

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

directory_id str

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

method str

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

notes str

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.

shared_directory_id str

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

target SharedDirectoryTargetArgs

Identifier for the directory consumer account with whom the directory is to be shared. See below.

directoryId String

Identifier of the Managed Microsoft AD directory that you want to share with other accounts.

method String

Method used when sharing a directory. Valid values are ORGANIZATIONS and HANDSHAKE. Default is HANDSHAKE.

notes 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.

sharedDirectoryId String

Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.

target Property Map

Identifier for the directory consumer account with whom the directory is to be shared. See below.

Supporting Types

SharedDirectoryTarget

Id string

Identifier of the directory consumer account.

Type string

Type of identifier to be used in the id field. Valid value is ACCOUNT. Default is ACCOUNT.

Id string

Identifier of the directory consumer account.

Type string

Type of identifier to be used in the id field. Valid value is ACCOUNT. Default is ACCOUNT.

id String

Identifier of the directory consumer account.

type String

Type of identifier to be used in the id field. Valid value is ACCOUNT. Default is ACCOUNT.

id string

Identifier of the directory consumer account.

type string

Type of identifier to be used in the id field. Valid value is ACCOUNT. Default is ACCOUNT.

id str

Identifier of the directory consumer account.

type str

Type of identifier to be used in the id field. Valid value is ACCOUNT. Default is ACCOUNT.

id String

Identifier of the directory consumer account.

type String

Type of identifier to be used in the id field. Valid value is ACCOUNT. Default is ACCOUNT.

Import

Directory Service Shared Directories can be imported using the owner directory ID/shared directory ID, e.g.,

 $ pulumi import aws:directoryservice/sharedDirectory:SharedDirectory example d-1234567890/d-9267633ece

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.