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
new Directory(name: string, args: DirectoryArgs, opts?: CustomResourceOptions);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:
- Directory
Id string The directory identifier for registration in WorkSpaces service.
- Self
Service DirectoryPermissions Self Service Permissions Args The permissions to enable or disable self-service capabilities.
- Subnet
Ids List<string> The identifiers of the subnets where the directory resides.
- Dictionary<string, string>
A map of tags assigned to the WorkSpaces directory.
- Directory
Id string The directory identifier for registration in WorkSpaces service.
- Self
Service DirectoryPermissions Self Service Permissions The permissions to enable or disable self-service capabilities.
- Subnet
Ids []string The identifiers of the subnets where the directory resides.
- map[string]string
A map of tags assigned to the WorkSpaces directory.
- directory
Id string The directory identifier for registration in WorkSpaces service.
- self
Service DirectoryPermissions Self Service Permissions The permissions to enable or disable self-service capabilities.
- subnet
Ids string[] The identifiers of the subnets where the directory resides.
- {[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_ Dict[Directorypermissions Self Service Permissions] The permissions to enable or disable self-service capabilities.
- subnet_
ids List[str] The identifiers of the subnets where the directory resides.
- 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.
- Customer
User stringName The user name for the service account.
- Directory
Name string The name of the directory.
- Directory
Type string The directory type.
- Dns
Ip List<string>Addresses The IP addresses of the DNS servers for the directory.
- Iam
Role stringId 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.
- Ip
Group List<string>Ids The identifiers of the IP access control groups associated with the directory.
- Registration
Code 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.
- Workspace
Security stringGroup Id The identifier of the security group that is assigned to new WorkSpaces.
- Alias string
The directory alias.
- Customer
User stringName The user name for the service account.
- Directory
Name string The name of the directory.
- Directory
Type string The directory type.
- Dns
Ip []stringAddresses The IP addresses of the DNS servers for the directory.
- Iam
Role stringId 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.
- Ip
Group []stringIds The identifiers of the IP access control groups associated with the directory.
- Registration
Code 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.
- Workspace
Security stringGroup Id The identifier of the security group that is assigned to new WorkSpaces.
- alias string
The directory alias.
- customer
User stringName The user name for the service account.
- directory
Name string The name of the directory.
- directory
Type string The directory type.
- dns
Ip string[]Addresses The IP addresses of the DNS servers for the directory.
- iam
Role stringId 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.
- ip
Group string[]Ids The identifiers of the IP access control groups associated with the directory.
- registration
Code 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.
- workspace
Security stringGroup Id The identifier of the security group that is assigned to new WorkSpaces.
- alias str
The directory alias.
- customer_
user_ strname The user name for the service account.
- directory_
name str The name of the directory.
- directory_
type str The directory type.
- dns_
ip_ List[str]addresses The IP addresses of the DNS servers for the directory.
- iam_
role_ strid 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_ List[str]ids 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_ strgroup_ id 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): Directorystatic 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.
- Customer
User stringName The user name for the service account.
- Directory
Id string The directory identifier for registration in WorkSpaces service.
- Directory
Name string The name of the directory.
- Directory
Type string The directory type.
- Dns
Ip List<string>Addresses The IP addresses of the DNS servers for the directory.
- Iam
Role stringId 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 List<string>Ids The identifiers of the IP access control groups associated with the directory.
- Registration
Code 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.
- Self
Service DirectoryPermissions Self Service Permissions Args The permissions to enable or disable self-service capabilities.
- Subnet
Ids List<string> The identifiers of the subnets where the directory resides.
- Dictionary<string, string>
A map of tags assigned to the WorkSpaces directory.
- Workspace
Security stringGroup Id The identifier of the security group that is assigned to new WorkSpaces.
- Alias string
The directory alias.
- Customer
User stringName The user name for the service account.
- Directory
Id string The directory identifier for registration in WorkSpaces service.
- Directory
Name string The name of the directory.
- Directory
Type string The directory type.
- Dns
Ip []stringAddresses The IP addresses of the DNS servers for the directory.
- Iam
Role stringId 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 []stringIds The identifiers of the IP access control groups associated with the directory.
- Registration
Code 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.
- Self
Service DirectoryPermissions Self Service Permissions The permissions to enable or disable self-service capabilities.
- Subnet
Ids []string The identifiers of the subnets where the directory resides.
- map[string]string
A map of tags assigned to the WorkSpaces directory.
- Workspace
Security stringGroup Id The identifier of the security group that is assigned to new WorkSpaces.
- alias string
The directory alias.
- customer
User stringName The user name for the service account.
- directory
Id string The directory identifier for registration in WorkSpaces service.
- directory
Name string The name of the directory.
- directory
Type string The directory type.
- dns
Ip string[]Addresses The IP addresses of the DNS servers for the directory.
- iam
Role stringId 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 string[]Ids The identifiers of the IP access control groups associated with the directory.
- registration
Code 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.
- self
Service DirectoryPermissions Self Service Permissions The permissions to enable or disable self-service capabilities.
- subnet
Ids string[] The identifiers of the subnets where the directory resides.
- {[key: string]: string}
A map of tags assigned to the WorkSpaces directory.
- workspace
Security stringGroup Id The identifier of the security group that is assigned to new WorkSpaces.
- alias str
The directory alias.
- customer_
user_ strname 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_ List[str]addresses The IP addresses of the DNS servers for the directory.
- iam_
role_ strid 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_ List[str]ids 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_ Dict[Directorypermissions Self Service Permissions] The permissions to enable or disable self-service capabilities.
- subnet_
ids List[str] The identifiers of the subnets where the directory resides.
- Dict[str, str]
A map of tags assigned to the WorkSpaces directory.
- workspace_
security_ strgroup_ id The identifier of the security group that is assigned to new WorkSpaces.
Supporting Types
DirectorySelfServicePermissions
- Change
Compute boolType Whether WorkSpaces directory users can change the compute type (bundle) for their workspace. Default
false.- Increase
Volume boolSize Whether WorkSpaces directory users can increase the volume size of the drives on their workspace. Default
false.- Rebuild
Workspace bool Whether WorkSpaces directory users can rebuild the operating system of a workspace to its original state. Default
false.- Restart
Workspace bool Whether WorkSpaces directory users can restart their workspace. Default
true.- Switch
Running boolMode Whether WorkSpaces directory users can switch the running mode of their workspace. Default
false.
- Change
Compute boolType Whether WorkSpaces directory users can change the compute type (bundle) for their workspace. Default
false.- Increase
Volume boolSize Whether WorkSpaces directory users can increase the volume size of the drives on their workspace. Default
false.- Rebuild
Workspace bool Whether WorkSpaces directory users can rebuild the operating system of a workspace to its original state. Default
false.- Restart
Workspace bool Whether WorkSpaces directory users can restart their workspace. Default
true.- Switch
Running boolMode Whether WorkSpaces directory users can switch the running mode of their workspace. Default
false.
- change
Compute booleanType Whether WorkSpaces directory users can change the compute type (bundle) for their workspace. Default
false.- increase
Volume booleanSize Whether WorkSpaces directory users can increase the volume size of the drives on their workspace. Default
false.- rebuild
Workspace boolean Whether WorkSpaces directory users can rebuild the operating system of a workspace to its original state. Default
false.- restart
Workspace boolean Whether WorkSpaces directory users can restart their workspace. Default
true.- switch
Running booleanMode Whether WorkSpaces directory users can switch the running mode of their workspace. Default
false.
- change
Compute boolType Whether WorkSpaces directory users can change the compute type (bundle) for their workspace. Default
false.- increase
Volume boolSize Whether WorkSpaces directory users can increase the volume size of the drives on their workspace. Default
false.- rebuild
Workspace bool Whether WorkSpaces directory users can rebuild the operating system of a workspace to its original state. Default
false.- restart
Workspace bool Whether WorkSpaces directory users can restart their workspace. Default
true.- switch
Running boolMode 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
awsTerraform Provider.