Resource: awsDirectoryServiceSharedDirectory
Manages a directory in your account (directory owner) shared with another account (directory consumer).
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsDirectoryServiceDirectoryExample =
new aws.directoryServiceDirectory.DirectoryServiceDirectory(this, "example", {
edition: "Standard",
name: "tf-example",
password: "SuperSecretPassw0rd",
type: "MicrosoftAD",
vpcSettings: {
subnetIds: "${aws_subnet.example[*].id}",
vpcId: "${aws_vpc.example.id}",
},
});
const awsDirectoryServiceSharedDirectoryExample =
new aws.directoryServiceSharedDirectory.DirectoryServiceSharedDirectory(
this,
"example_1",
{
directoryId: awsDirectoryServiceDirectoryExample.id,
notes: "You wanna have a catch?",
target: {
id: "${data.aws_caller_identity.receiver.account_id}",
},
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsDirectoryServiceSharedDirectoryExample.overrideLogicalId("example");
Argument Reference
The following arguments are required:
directoryId
- (Required) Identifier of the Managed Microsoft AD directory that you want to share with other accounts.target
- (Required) Identifier for the directory consumer account with whom the directory is to be shared. See below.
The following arguments are optional:
method
- (Optional) Method used when sharing a directory. Valid values areorganizations
andhandshake
. Default ishandshake
.notes
- (Optional, Sensitive) 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.
target
id
- (Required) Identifier of the directory consumer account.type
- (Optional) Type of identifier to be used in theid
field. Valid value isaccount
. Default isaccount
.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- Identifier of the shared directory.sharedDirectoryId
- Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
Timeouts
awsDirectoryServiceSharedDirectory
provides the following Timeouts configuration options:
delete
- (Default60Minutes
) Used for shared directory deletion
Import
Directory Service Shared Directories can be imported using the owner directory ID/shared directory ID, e.g.,