Directory

Provides a directory registration in AWS WorkSpaces Service

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var mainVpc = new Aws.Ec2.Vpc("mainVpc", new Aws.Ec2.VpcArgs
        {
            CidrBlock = "10.0.0.0/16",
        });
        var private_a = new Aws.Ec2.Subnet("private-a", new Aws.Ec2.SubnetArgs
        {
            AvailabilityZone = "us-east-1a",
            CidrBlock = "10.0.0.0/24",
            VpcId = mainVpc.Id,
        });
        var private_b = new Aws.Ec2.Subnet("private-b", new Aws.Ec2.SubnetArgs
        {
            AvailabilityZone = "us-east-1b",
            CidrBlock = "10.0.1.0/24",
            VpcId = mainVpc.Id,
        });
        var mainDirectory = new Aws.DirectoryService.Directory("mainDirectory", new Aws.DirectoryService.DirectoryArgs
        {
            Password = "#S1ncerely",
            Size = "Small",
            VpcSettings = new Aws.DirectoryService.Inputs.DirectoryVpcSettingsArgs
            {
                SubnetIds = 
                {
                    private_a.Id,
                    private_b.Id,
                },
                VpcId = mainVpc.Id,
            },
        });
        var mainWorkspaces_directoryDirectory = new Aws.Workspaces.Directory("mainWorkspaces/directoryDirectory", new Aws.Workspaces.DirectoryArgs
        {
            DirectoryId = mainDirectory.Id,
            SelfServicePermissions = new Aws.Workspaces.Inputs.DirectorySelfServicePermissionsArgs
            {
                IncreaseVolumeSize = true,
                RebuildWorkspace = true,
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/directoryservice"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/workspaces"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        mainVpc, err := ec2.NewVpc(ctx, "mainVpc", &ec2.VpcArgs{
            CidrBlock: pulumi.String("10.0.0.0/16"),
        })
        if err != nil {
            return err
        }
        _, err = ec2.NewSubnet(ctx, "private_a", &ec2.SubnetArgs{
            AvailabilityZone: pulumi.String("us-east-1a"),
            CidrBlock:        pulumi.String("10.0.0.0/24"),
            VpcId:            mainVpc.ID(),
        })
        if err != nil {
            return err
        }
        _, err = ec2.NewSubnet(ctx, "private_b", &ec2.SubnetArgs{
            AvailabilityZone: pulumi.String("us-east-1b"),
            CidrBlock:        pulumi.String("10.0.1.0/24"),
            VpcId:            mainVpc.ID(),
        })
        if err != nil {
            return err
        }
        mainDirectory, err := directoryservice.NewDirectory(ctx, "mainDirectory", &directoryservice.DirectoryArgs{
            Password: pulumi.String("#S1ncerely"),
            Size:     pulumi.String("Small"),
            VpcSettings: &directoryservice.DirectoryVpcSettingsArgs{
                SubnetIds: pulumi.StringArray{
                    private_a.ID(),
                    private_b.ID(),
                },
                VpcId: mainVpc.ID(),
            },
        })
        if err != nil {
            return err
        }
        _, err = workspaces.NewDirectory(ctx, "mainWorkspaces_directoryDirectory", &workspaces.DirectoryArgs{
            DirectoryId: mainDirectory.ID(),
            SelfServicePermissions: &workspaces.DirectorySelfServicePermissionsArgs{
                IncreaseVolumeSize: pulumi.Bool(true),
                RebuildWorkspace:   pulumi.Bool(true),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

main_vpc = aws.ec2.Vpc("mainVpc", cidr_block="10.0.0.0/16")
private_a = aws.ec2.Subnet("private-a",
    availability_zone="us-east-1a",
    cidr_block="10.0.0.0/24",
    vpc_id=main_vpc.id)
private_b = aws.ec2.Subnet("private-b",
    availability_zone="us-east-1b",
    cidr_block="10.0.1.0/24",
    vpc_id=main_vpc.id)
main_directory = aws.directoryservice.Directory("mainDirectory",
    password="#S1ncerely",
    size="Small",
    vpc_settings={
        "subnet_ids": [
            private_a.id,
            private_b.id,
        ],
        "vpc_id": main_vpc.id,
    })
main_workspaces_directory_directory = aws.workspaces.Directory("mainWorkspaces/directoryDirectory",
    directory_id=main_directory.id,
    self_service_permissions={
        "increaseVolumeSize": True,
        "rebuildWorkspace": True,
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const mainVpc = new aws.ec2.Vpc("main", {
    cidrBlock: "10.0.0.0/16",
});
const private_a = new aws.ec2.Subnet("private-a", {
    availabilityZone: "us-east-1a",
    cidrBlock: "10.0.0.0/24",
    vpcId: mainVpc.id,
});
const private_b = new aws.ec2.Subnet("private-b", {
    availabilityZone: "us-east-1b",
    cidrBlock: "10.0.1.0/24",
    vpcId: mainVpc.id,
});
const mainDirectory = new aws.directoryservice.Directory("main", {
    password: "#S1ncerely",
    size: "Small",
    vpcSettings: {
        subnetIds: [
            private_a.id,
            private_b.id,
        ],
        vpcId: mainVpc.id,
    },
});
const mainWorkspacesDirectory = new aws.workspaces.Directory("main", {
    directoryId: mainDirectory.id,
    selfServicePermissions: {
        increaseVolumeSize: true,
        rebuildWorkspace: true,
    },
});

Create a Directory Resource

def Directory(resource_name, opts=None, directory_id=None, self_service_permissions=None, subnet_ids=None, tags=None, __props__=None);
func NewDirectory(ctx *Context, name string, args DirectoryArgs, opts ...ResourceOption) (*Directory, error)
public Directory(string name, DirectoryArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DirectoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DirectoryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DirectoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Directory Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Directory resource accepts the following input properties:

DirectoryId string

The directory identifier for registration in WorkSpaces service.

SelfServicePermissions DirectorySelfServicePermissionsArgs

The permissions to enable or disable self-service capabilities.

SubnetIds List<string>

The identifiers of the subnets where the directory resides.

Tags Dictionary<string, string>

A map of tags assigned to the WorkSpaces directory.

DirectoryId string

The directory identifier for registration in WorkSpaces service.

SelfServicePermissions DirectorySelfServicePermissions

The permissions to enable or disable self-service capabilities.

SubnetIds []string

The identifiers of the subnets where the directory resides.

Tags map[string]string

A map of tags assigned to the WorkSpaces directory.

directoryId string

The directory identifier for registration in WorkSpaces service.

selfServicePermissions DirectorySelfServicePermissions

The permissions to enable or disable self-service capabilities.

subnetIds string[]

The identifiers of the subnets where the directory resides.

tags {[key: string]: string}

A map of tags assigned to the WorkSpaces directory.

directory_id str

The directory identifier for registration in WorkSpaces service.

self_service_permissions Dict[DirectorySelfServicePermissions]

The permissions to enable or disable self-service capabilities.

subnet_ids List[str]

The identifiers of the subnets where the directory resides.

tags Dict[str, str]

A map of tags assigned to the WorkSpaces directory.

Outputs

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

Alias string

The directory alias.

CustomerUserName string

The user name for the service account.

DirectoryName string

The name of the directory.

DirectoryType string

The directory type.

DnsIpAddresses List<string>

The IP addresses of the DNS servers for the directory.

IamRoleId string

The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

Id string
The provider-assigned unique ID for this managed resource.
IpGroupIds List<string>

The identifiers of the IP access control groups associated with the directory.

RegistrationCode string

The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

WorkspaceSecurityGroupId string

The identifier of the security group that is assigned to new WorkSpaces.

Alias string

The directory alias.

CustomerUserName string

The user name for the service account.

DirectoryName string

The name of the directory.

DirectoryType string

The directory type.

DnsIpAddresses []string

The IP addresses of the DNS servers for the directory.

IamRoleId string

The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

Id string
The provider-assigned unique ID for this managed resource.
IpGroupIds []string

The identifiers of the IP access control groups associated with the directory.

RegistrationCode string

The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

WorkspaceSecurityGroupId string

The identifier of the security group that is assigned to new WorkSpaces.

alias string

The directory alias.

customerUserName string

The user name for the service account.

directoryName string

The name of the directory.

directoryType string

The directory type.

dnsIpAddresses string[]

The IP addresses of the DNS servers for the directory.

iamRoleId string

The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

id string
The provider-assigned unique ID for this managed resource.
ipGroupIds string[]

The identifiers of the IP access control groups associated with the directory.

registrationCode string

The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

workspaceSecurityGroupId string

The identifier of the security group that is assigned to new WorkSpaces.

alias str

The directory alias.

customer_user_name str

The user name for the service account.

directory_name str

The name of the directory.

directory_type str

The directory type.

dns_ip_addresses List[str]

The IP addresses of the DNS servers for the directory.

iam_role_id str

The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

id str
The provider-assigned unique ID for this managed resource.
ip_group_ids List[str]

The identifiers of the IP access control groups associated with the directory.

registration_code str

The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

workspace_security_group_id str

The identifier of the security group that is assigned to new WorkSpaces.

Look up an Existing Directory Resource

Get an existing Directory 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?: DirectoryState, opts?: CustomResourceOptions): Directory
static get(resource_name, id, opts=None, alias=None, customer_user_name=None, directory_id=None, directory_name=None, directory_type=None, dns_ip_addresses=None, iam_role_id=None, ip_group_ids=None, registration_code=None, self_service_permissions=None, subnet_ids=None, tags=None, workspace_security_group_id=None, __props__=None);
func GetDirectory(ctx *Context, name string, id IDInput, state *DirectoryState, opts ...ResourceOption) (*Directory, error)
public static Directory Get(string name, Input<string> id, DirectoryState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Alias string

The directory alias.

CustomerUserName string

The user name for the service account.

DirectoryId string

The directory identifier for registration in WorkSpaces service.

DirectoryName string

The name of the directory.

DirectoryType string

The directory type.

DnsIpAddresses List<string>

The IP addresses of the DNS servers for the directory.

IamRoleId string

The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

IpGroupIds List<string>

The identifiers of the IP access control groups associated with the directory.

RegistrationCode string

The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

SelfServicePermissions DirectorySelfServicePermissionsArgs

The permissions to enable or disable self-service capabilities.

SubnetIds List<string>

The identifiers of the subnets where the directory resides.

Tags Dictionary<string, string>

A map of tags assigned to the WorkSpaces directory.

WorkspaceSecurityGroupId string

The identifier of the security group that is assigned to new WorkSpaces.

Alias string

The directory alias.

CustomerUserName string

The user name for the service account.

DirectoryId string

The directory identifier for registration in WorkSpaces service.

DirectoryName string

The name of the directory.

DirectoryType string

The directory type.

DnsIpAddresses []string

The IP addresses of the DNS servers for the directory.

IamRoleId string

The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

IpGroupIds []string

The identifiers of the IP access control groups associated with the directory.

RegistrationCode string

The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

SelfServicePermissions DirectorySelfServicePermissions

The permissions to enable or disable self-service capabilities.

SubnetIds []string

The identifiers of the subnets where the directory resides.

Tags map[string]string

A map of tags assigned to the WorkSpaces directory.

WorkspaceSecurityGroupId string

The identifier of the security group that is assigned to new WorkSpaces.

alias string

The directory alias.

customerUserName string

The user name for the service account.

directoryId string

The directory identifier for registration in WorkSpaces service.

directoryName string

The name of the directory.

directoryType string

The directory type.

dnsIpAddresses string[]

The IP addresses of the DNS servers for the directory.

iamRoleId string

The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

ipGroupIds string[]

The identifiers of the IP access control groups associated with the directory.

registrationCode string

The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

selfServicePermissions DirectorySelfServicePermissions

The permissions to enable or disable self-service capabilities.

subnetIds string[]

The identifiers of the subnets where the directory resides.

tags {[key: string]: string}

A map of tags assigned to the WorkSpaces directory.

workspaceSecurityGroupId string

The identifier of the security group that is assigned to new WorkSpaces.

alias str

The directory alias.

customer_user_name str

The user name for the service account.

directory_id str

The directory identifier for registration in WorkSpaces service.

directory_name str

The name of the directory.

directory_type str

The directory type.

dns_ip_addresses List[str]

The IP addresses of the DNS servers for the directory.

iam_role_id str

The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

ip_group_ids List[str]

The identifiers of the IP access control groups associated with the directory.

registration_code str

The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

self_service_permissions Dict[DirectorySelfServicePermissions]

The permissions to enable or disable self-service capabilities.

subnet_ids List[str]

The identifiers of the subnets where the directory resides.

tags Dict[str, str]

A map of tags assigned to the WorkSpaces directory.

workspace_security_group_id str

The identifier of the security group that is assigned to new WorkSpaces.

Supporting Types

DirectorySelfServicePermissions

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

ChangeComputeType bool

Whether WorkSpaces directory users can change the compute type (bundle) for their workspace. Default false.

IncreaseVolumeSize bool

Whether WorkSpaces directory users can increase the volume size of the drives on their workspace. Default false.

RebuildWorkspace bool

Whether WorkSpaces directory users can rebuild the operating system of a workspace to its original state. Default false.

RestartWorkspace bool

Whether WorkSpaces directory users can restart their workspace. Default true.

SwitchRunningMode bool

Whether WorkSpaces directory users can switch the running mode of their workspace. Default false.

ChangeComputeType bool

Whether WorkSpaces directory users can change the compute type (bundle) for their workspace. Default false.

IncreaseVolumeSize bool

Whether WorkSpaces directory users can increase the volume size of the drives on their workspace. Default false.

RebuildWorkspace bool

Whether WorkSpaces directory users can rebuild the operating system of a workspace to its original state. Default false.

RestartWorkspace bool

Whether WorkSpaces directory users can restart their workspace. Default true.

SwitchRunningMode bool

Whether WorkSpaces directory users can switch the running mode of their workspace. Default false.

changeComputeType boolean

Whether WorkSpaces directory users can change the compute type (bundle) for their workspace. Default false.

increaseVolumeSize boolean

Whether WorkSpaces directory users can increase the volume size of the drives on their workspace. Default false.

rebuildWorkspace boolean

Whether WorkSpaces directory users can rebuild the operating system of a workspace to its original state. Default false.

restartWorkspace boolean

Whether WorkSpaces directory users can restart their workspace. Default true.

switchRunningMode boolean

Whether WorkSpaces directory users can switch the running mode of their workspace. Default false.

changeComputeType bool

Whether WorkSpaces directory users can change the compute type (bundle) for their workspace. Default false.

increaseVolumeSize bool

Whether WorkSpaces directory users can increase the volume size of the drives on their workspace. Default false.

rebuildWorkspace bool

Whether WorkSpaces directory users can rebuild the operating system of a workspace to its original state. Default false.

restartWorkspace bool

Whether WorkSpaces directory users can restart their workspace. Default true.

switchRunningMode bool

Whether WorkSpaces directory users can switch the running mode of their workspace. Default false.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.