aws.directoryservice.SharedDirectory
Explore with Pulumi AI
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", {
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 pulumi
import pulumi_aws as aws
example = aws.directoryservice.Directory("example",
name="tf-example",
password="SuperSecretPassw0rd",
type="MicrosoftAD",
edition="Standard",
vpc_settings={
"vpc_id": example_aws_vpc["id"],
"subnet_ids": [__item["id"] for __item in example_aws_subnet],
})
example_shared_directory = aws.directoryservice.SharedDirectory("example",
directory_id=example.id,
notes="You wanna have a catch?",
target={
"id": receiver["accountId"],
})
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 {
example, err := directoryservice.NewDirectory(ctx, "example", &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(exampleAwsVpc.Id),
SubnetIds: []pulumi.String(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:7,17-39)),
},
})
if err != nil {
return err
}
_, err = directoryservice.NewSharedDirectory(ctx, "example", &directoryservice.SharedDirectoryArgs{
DirectoryId: example.ID(),
Notes: pulumi.String("You wanna have a catch?"),
Target: &directoryservice.SharedDirectoryTargetArgs{
Id: pulumi.Any(receiver.AccountId),
},
})
if err != nil {
return err
}
return nil
})
}
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()
{
Name = "tf-example",
Password = "SuperSecretPassw0rd",
Type = "MicrosoftAD",
Edition = "Standard",
VpcSettings = new Aws.DirectoryService.Inputs.DirectoryVpcSettingsArgs
{
VpcId = exampleAwsVpc.Id,
SubnetIds = exampleAwsSubnet.Select(__item => __item.Id).ToList(),
},
});
var exampleSharedDirectory = new Aws.DirectoryService.SharedDirectory("example", new()
{
DirectoryId = example.Id,
Notes = "You wanna have a catch?",
Target = new Aws.DirectoryService.Inputs.SharedDirectoryTargetArgs
{
Id = receiver.AccountId,
},
});
});
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 example = new Directory("example", DirectoryArgs.builder()
.name("tf-example")
.password("SuperSecretPassw0rd")
.type("MicrosoftAD")
.edition("Standard")
.vpcSettings(DirectoryVpcSettingsArgs.builder()
.vpcId(exampleAwsVpc.id())
.subnetIds(exampleAwsSubnet.stream().map(element -> element.id()).collect(toList()))
.build())
.build());
var exampleSharedDirectory = new SharedDirectory("exampleSharedDirectory", SharedDirectoryArgs.builder()
.directoryId(example.id())
.notes("You wanna have a catch?")
.target(SharedDirectoryTargetArgs.builder()
.id(receiver.accountId())
.build())
.build());
}
}
Coming soon!
Create SharedDirectory Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SharedDirectory(name: string, args: SharedDirectoryArgs, opts?: CustomResourceOptions);
@overload
def SharedDirectory(resource_name: str,
args: SharedDirectoryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SharedDirectory(resource_name: str,
opts: Optional[ResourceOptions] = None,
directory_id: Optional[str] = None,
target: Optional[SharedDirectoryTargetArgs] = None,
method: Optional[str] = None,
notes: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var sharedDirectoryResource = new Aws.DirectoryService.SharedDirectory("sharedDirectoryResource", new()
{
DirectoryId = "string",
Target = new Aws.DirectoryService.Inputs.SharedDirectoryTargetArgs
{
Id = "string",
Type = "string",
},
Method = "string",
Notes = "string",
});
example, err := directoryservice.NewSharedDirectory(ctx, "sharedDirectoryResource", &directoryservice.SharedDirectoryArgs{
DirectoryId: pulumi.String("string"),
Target: &directoryservice.SharedDirectoryTargetArgs{
Id: pulumi.String("string"),
Type: pulumi.String("string"),
},
Method: pulumi.String("string"),
Notes: pulumi.String("string"),
})
var sharedDirectoryResource = new SharedDirectory("sharedDirectoryResource", SharedDirectoryArgs.builder()
.directoryId("string")
.target(SharedDirectoryTargetArgs.builder()
.id("string")
.type("string")
.build())
.method("string")
.notes("string")
.build());
shared_directory_resource = aws.directoryservice.SharedDirectory("sharedDirectoryResource",
directory_id="string",
target={
"id": "string",
"type": "string",
},
method="string",
notes="string")
const sharedDirectoryResource = new aws.directoryservice.SharedDirectory("sharedDirectoryResource", {
directoryId: "string",
target: {
id: "string",
type: "string",
},
method: "string",
notes: "string",
});
type: aws:directoryservice:SharedDirectory
properties:
directoryId: string
method: string
notes: string
target:
id: string
type: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.