1. Packages
  2. AWS Classic
  3. API Docs
  4. directoryservice
  5. SharedDirectoryAccepter

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi

aws.directoryservice.SharedDirectoryAccepter

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi

    Accepts a shared directory in a consumer account.

    NOTE: Destroying this resource removes the shared directory from the consumer account only.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleSharedDirectory = new Aws.DirectoryService.SharedDirectory("exampleSharedDirectory", new()
        {
            DirectoryId = aws_directory_service_directory.Example.Id,
            Notes = "example",
            Target = new Aws.DirectoryService.Inputs.SharedDirectoryTargetArgs
            {
                Id = data.Aws_caller_identity.Receiver.Account_id,
            },
        });
    
        var exampleSharedDirectoryAccepter = new Aws.DirectoryService.SharedDirectoryAccepter("exampleSharedDirectoryAccepter", new()
        {
            SharedDirectoryId = exampleSharedDirectory.SharedDirectoryId,
        }, new CustomResourceOptions
        {
            Provider = "awsalternate",
        });
    
    });
    
    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 {
    		exampleSharedDirectory, err := directoryservice.NewSharedDirectory(ctx, "exampleSharedDirectory", &directoryservice.SharedDirectoryArgs{
    			DirectoryId: pulumi.Any(aws_directory_service_directory.Example.Id),
    			Notes:       pulumi.String("example"),
    			Target: &directoryservice.SharedDirectoryTargetArgs{
    				Id: pulumi.Any(data.Aws_caller_identity.Receiver.Account_id),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = directoryservice.NewSharedDirectoryAccepter(ctx, "exampleSharedDirectoryAccepter", &directoryservice.SharedDirectoryAccepterArgs{
    			SharedDirectoryId: exampleSharedDirectory.SharedDirectoryId,
    		}, pulumi.Provider("awsalternate"))
    		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.SharedDirectory;
    import com.pulumi.aws.directoryservice.SharedDirectoryArgs;
    import com.pulumi.aws.directoryservice.inputs.SharedDirectoryTargetArgs;
    import com.pulumi.aws.directoryservice.SharedDirectoryAccepter;
    import com.pulumi.aws.directoryservice.SharedDirectoryAccepterArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 exampleSharedDirectory = new SharedDirectory("exampleSharedDirectory", SharedDirectoryArgs.builder()        
                .directoryId(aws_directory_service_directory.example().id())
                .notes("example")
                .target(SharedDirectoryTargetArgs.builder()
                    .id(data.aws_caller_identity().receiver().account_id())
                    .build())
                .build());
    
            var exampleSharedDirectoryAccepter = new SharedDirectoryAccepter("exampleSharedDirectoryAccepter", SharedDirectoryAccepterArgs.builder()        
                .sharedDirectoryId(exampleSharedDirectory.sharedDirectoryId())
                .build(), CustomResourceOptions.builder()
                    .provider("awsalternate")
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example_shared_directory = aws.directoryservice.SharedDirectory("exampleSharedDirectory",
        directory_id=aws_directory_service_directory["example"]["id"],
        notes="example",
        target=aws.directoryservice.SharedDirectoryTargetArgs(
            id=data["aws_caller_identity"]["receiver"]["account_id"],
        ))
    example_shared_directory_accepter = aws.directoryservice.SharedDirectoryAccepter("exampleSharedDirectoryAccepter", shared_directory_id=example_shared_directory.shared_directory_id,
    opts=pulumi.ResourceOptions(provider="awsalternate"))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const exampleSharedDirectory = new aws.directoryservice.SharedDirectory("exampleSharedDirectory", {
        directoryId: aws_directory_service_directory.example.id,
        notes: "example",
        target: {
            id: data.aws_caller_identity.receiver.account_id,
        },
    });
    const exampleSharedDirectoryAccepter = new aws.directoryservice.SharedDirectoryAccepter("exampleSharedDirectoryAccepter", {sharedDirectoryId: exampleSharedDirectory.sharedDirectoryId}, {
        provider: "awsalternate",
    });
    
    resources:
      exampleSharedDirectory:
        type: aws:directoryservice:SharedDirectory
        properties:
          directoryId: ${aws_directory_service_directory.example.id}
          notes: example
          target:
            id: ${data.aws_caller_identity.receiver.account_id}
      exampleSharedDirectoryAccepter:
        type: aws:directoryservice:SharedDirectoryAccepter
        properties:
          sharedDirectoryId: ${exampleSharedDirectory.sharedDirectoryId}
        options:
          provider: awsalternate
    

    Create SharedDirectoryAccepter Resource

    new SharedDirectoryAccepter(name: string, args: SharedDirectoryAccepterArgs, opts?: CustomResourceOptions);
    @overload
    def SharedDirectoryAccepter(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                shared_directory_id: Optional[str] = None)
    @overload
    def SharedDirectoryAccepter(resource_name: str,
                                args: SharedDirectoryAccepterArgs,
                                opts: Optional[ResourceOptions] = None)
    func NewSharedDirectoryAccepter(ctx *Context, name string, args SharedDirectoryAccepterArgs, opts ...ResourceOption) (*SharedDirectoryAccepter, error)
    public SharedDirectoryAccepter(string name, SharedDirectoryAccepterArgs args, CustomResourceOptions? opts = null)
    public SharedDirectoryAccepter(String name, SharedDirectoryAccepterArgs args)
    public SharedDirectoryAccepter(String name, SharedDirectoryAccepterArgs args, CustomResourceOptions options)
    
    type: aws:directoryservice:SharedDirectoryAccepter
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args SharedDirectoryAccepterArgs
    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 SharedDirectoryAccepterArgs
    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 SharedDirectoryAccepterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SharedDirectoryAccepterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SharedDirectoryAccepterArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    SharedDirectoryAccepter 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 SharedDirectoryAccepter resource accepts the following input properties:

    SharedDirectoryId string

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

    SharedDirectoryId string

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

    sharedDirectoryId String

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

    sharedDirectoryId string

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

    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.

    sharedDirectoryId String

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

    Outputs

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

    Id string

    The provider-assigned unique ID for this managed resource.

    Method string

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    OwnerAccountId string

    Account identifier of the directory owner.

    OwnerDirectoryId string

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    Id string

    The provider-assigned unique ID for this managed resource.

    Method string

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    OwnerAccountId string

    Account identifier of the directory owner.

    OwnerDirectoryId string

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    id String

    The provider-assigned unique ID for this managed resource.

    method String

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    ownerAccountId String

    Account identifier of the directory owner.

    ownerDirectoryId String

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    id string

    The provider-assigned unique ID for this managed resource.

    method string

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    ownerAccountId string

    Account identifier of the directory owner.

    ownerDirectoryId string

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    id str

    The provider-assigned unique ID for this managed resource.

    method str

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    owner_account_id str

    Account identifier of the directory owner.

    owner_directory_id str

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    id String

    The provider-assigned unique ID for this managed resource.

    method String

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    ownerAccountId String

    Account identifier of the directory owner.

    ownerDirectoryId String

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    Look up Existing SharedDirectoryAccepter Resource

    Get an existing SharedDirectoryAccepter 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?: SharedDirectoryAccepterState, opts?: CustomResourceOptions): SharedDirectoryAccepter
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            method: Optional[str] = None,
            notes: Optional[str] = None,
            owner_account_id: Optional[str] = None,
            owner_directory_id: Optional[str] = None,
            shared_directory_id: Optional[str] = None) -> SharedDirectoryAccepter
    func GetSharedDirectoryAccepter(ctx *Context, name string, id IDInput, state *SharedDirectoryAccepterState, opts ...ResourceOption) (*SharedDirectoryAccepter, error)
    public static SharedDirectoryAccepter Get(string name, Input<string> id, SharedDirectoryAccepterState? state, CustomResourceOptions? opts = null)
    public static SharedDirectoryAccepter get(String name, Output<String> id, SharedDirectoryAccepterState 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:
    Method string

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    OwnerAccountId string

    Account identifier of the directory owner.

    OwnerDirectoryId string

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    SharedDirectoryId string

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

    Method string

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    OwnerAccountId string

    Account identifier of the directory owner.

    OwnerDirectoryId string

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    SharedDirectoryId string

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

    method String

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    ownerAccountId String

    Account identifier of the directory owner.

    ownerDirectoryId String

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    sharedDirectoryId String

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

    method string

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    ownerAccountId string

    Account identifier of the directory owner.

    ownerDirectoryId string

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    sharedDirectoryId string

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

    method str

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    owner_account_id str

    Account identifier of the directory owner.

    owner_directory_id str

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    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.

    method String

    Method used when sharing a directory (i.e., ORGANIZATIONS or 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.

    ownerAccountId String

    Account identifier of the directory owner.

    ownerDirectoryId String

    Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.

    sharedDirectoryId String

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

    Import

    Using pulumi import, import Directory Service Shared Directories using the shared directory ID. For example:

     $ pulumi import aws:directoryservice/sharedDirectoryAccepter:SharedDirectoryAccepter example 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.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.3.0 published on Thursday, Sep 28, 2023 by Pulumi