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.44.0 published on Monday, Jul 8, 2024 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.44.0 published on Monday, Jul 8, 2024 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

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.directoryservice.SharedDirectory("example", {
        directoryId: exampleAwsDirectoryServiceDirectory.id,
        notes: "example",
        target: {
            id: receiver.accountId,
        },
    });
    const exampleSharedDirectoryAccepter = new aws.directoryservice.SharedDirectoryAccepter("example", {sharedDirectoryId: example.sharedDirectoryId});
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.directoryservice.SharedDirectory("example",
        directory_id=example_aws_directory_service_directory["id"],
        notes="example",
        target={
            "id": receiver["accountId"],
        })
    example_shared_directory_accepter = aws.directoryservice.SharedDirectoryAccepter("example", shared_directory_id=example.shared_directory_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 {
    		example, err := directoryservice.NewSharedDirectory(ctx, "example", &directoryservice.SharedDirectoryArgs{
    			DirectoryId: pulumi.Any(exampleAwsDirectoryServiceDirectory.Id),
    			Notes:       pulumi.String("example"),
    			Target: &directoryservice.SharedDirectoryTargetArgs{
    				Id: pulumi.Any(receiver.AccountId),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = directoryservice.NewSharedDirectoryAccepter(ctx, "example", &directoryservice.SharedDirectoryAccepterArgs{
    			SharedDirectoryId: example.SharedDirectoryId,
    		})
    		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.SharedDirectory("example", new()
        {
            DirectoryId = exampleAwsDirectoryServiceDirectory.Id,
            Notes = "example",
            Target = new Aws.DirectoryService.Inputs.SharedDirectoryTargetArgs
            {
                Id = receiver.AccountId,
            },
        });
    
        var exampleSharedDirectoryAccepter = new Aws.DirectoryService.SharedDirectoryAccepter("example", new()
        {
            SharedDirectoryId = example.SharedDirectoryId,
        });
    
    });
    
    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 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 SharedDirectory("example", SharedDirectoryArgs.builder()
                .directoryId(exampleAwsDirectoryServiceDirectory.id())
                .notes("example")
                .target(SharedDirectoryTargetArgs.builder()
                    .id(receiver.accountId())
                    .build())
                .build());
    
            var exampleSharedDirectoryAccepter = new SharedDirectoryAccepter("exampleSharedDirectoryAccepter", SharedDirectoryAccepterArgs.builder()
                .sharedDirectoryId(example.sharedDirectoryId())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:directoryservice:SharedDirectory
        properties:
          directoryId: ${exampleAwsDirectoryServiceDirectory.id}
          notes: example
          target:
            id: ${receiver.accountId}
      exampleSharedDirectoryAccepter:
        type: aws:directoryservice:SharedDirectoryAccepter
        name: example
        properties:
          sharedDirectoryId: ${example.sharedDirectoryId}
    

    Create SharedDirectoryAccepter Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SharedDirectoryAccepter(name: string, args: SharedDirectoryAccepterArgs, opts?: CustomResourceOptions);
    @overload
    def SharedDirectoryAccepter(resource_name: str,
                                args: SharedDirectoryAccepterArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def SharedDirectoryAccepter(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                shared_directory_id: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var sharedDirectoryAccepterResource = new Aws.DirectoryService.SharedDirectoryAccepter("sharedDirectoryAccepterResource", new()
    {
        SharedDirectoryId = "string",
    });
    
    example, err := directoryservice.NewSharedDirectoryAccepter(ctx, "sharedDirectoryAccepterResource", &directoryservice.SharedDirectoryAccepterArgs{
    	SharedDirectoryId: pulumi.String("string"),
    })
    
    var sharedDirectoryAccepterResource = new SharedDirectoryAccepter("sharedDirectoryAccepterResource", SharedDirectoryAccepterArgs.builder()
        .sharedDirectoryId("string")
        .build());
    
    shared_directory_accepter_resource = aws.directoryservice.SharedDirectoryAccepter("sharedDirectoryAccepterResource", shared_directory_id="string")
    
    const sharedDirectoryAccepterResource = new aws.directoryservice.SharedDirectoryAccepter("sharedDirectoryAccepterResource", {sharedDirectoryId: "string"});
    
    type: aws:directoryservice:SharedDirectoryAccepter
    properties:
        sharedDirectoryId: string
    

    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
    

    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.
    aws logo

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

    AWS Classic v6.44.0 published on Monday, Jul 8, 2024 by Pulumi