Try AWS Native preview for resources not in the classic version.
aws.directoryservice.SharedDirectory
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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,
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directoryservice"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleDirectory, err := directoryservice.NewDirectory(ctx, "exampleDirectory", &directoryservice.DirectoryArgs{
Name: pulumi.String("tf-example"),
Password: pulumi.String("SuperSecretPassw0rd"),
Type: pulumi.String("MicrosoftAD"),
Edition: pulumi.String("Standard"),
VpcSettings: &directoryservice.DirectoryVpcSettingsArgs{
VpcId: pulumi.Any(aws_vpc.Example.Id),
SubnetIds: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-resources-aws:directoryservice-sharedDirectory:SharedDirectory.pp:7,17-41),
},
})
if err != nil {
return err
}
_, err = directoryservice.NewSharedDirectory(ctx, "exampleSharedDirectory", &directoryservice.SharedDirectoryArgs{
DirectoryId: exampleDirectory.ID(),
Notes: pulumi.String("You wanna have a catch?"),
Target: &directoryservice.SharedDirectoryTargetArgs{
Id: pulumi.Any(data.Aws_caller_identity.Receiver.Account_id),
},
})
if err != nil {
return err
}
return nil
})
}
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:
- Directory
Id string Identifier of the Managed Microsoft AD directory that you want to share with other accounts.
- Target
Shared
Directory Target Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- Method string
Method used when sharing a directory. Valid values are
ORGANIZATIONS
andHANDSHAKE
. Default isHANDSHAKE
.- 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 string Identifier of the Managed Microsoft AD directory that you want to share with other accounts.
- Target
Shared
Directory Target Args Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- Method string
Method used when sharing a directory. Valid values are
ORGANIZATIONS
andHANDSHAKE
. Default isHANDSHAKE
.- 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 String Identifier of the Managed Microsoft AD directory that you want to share with other accounts.
- target
Shared
Directory Target Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- method String
Method used when sharing a directory. Valid values are
ORGANIZATIONS
andHANDSHAKE
. Default isHANDSHAKE
.- 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 string Identifier of the Managed Microsoft AD directory that you want to share with other accounts.
- target
Shared
Directory Target Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- method string
Method used when sharing a directory. Valid values are
ORGANIZATIONS
andHANDSHAKE
. Default isHANDSHAKE
.- 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
Shared
Directory Target Args Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- method str
Method used when sharing a directory. Valid values are
ORGANIZATIONS
andHANDSHAKE
. Default isHANDSHAKE
.- 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.
- directory
Id 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.
The following arguments are optional:
- method String
Method used when sharing a directory. Valid values are
ORGANIZATIONS
andHANDSHAKE
. Default isHANDSHAKE
.- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Directory
Id 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
andHANDSHAKE
. Default isHANDSHAKE
.- 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.
- string
Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
- Target
Shared
Directory Target Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- Directory
Id 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
andHANDSHAKE
. Default isHANDSHAKE
.- 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.
- string
Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
- Target
Shared
Directory Target Args Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- directory
Id 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
andHANDSHAKE
. Default isHANDSHAKE
.- 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.
- String
Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
- target
Shared
Directory Target Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- directory
Id 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
andHANDSHAKE
. Default isHANDSHAKE
.- 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.
- string
Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
- target
Shared
Directory Target Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- 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
andHANDSHAKE
. Default isHANDSHAKE
.- 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.
- str
Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
- target
Shared
Directory Target Args Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
- directory
Id 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
andHANDSHAKE
. Default isHANDSHAKE
.- 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.
- 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.
The following arguments are optional:
Supporting Types
SharedDirectoryTarget, SharedDirectoryTargetArgs
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
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.