AWS WorkSpaces Directory
This page shows how to write Terraform and CloudFormation for WorkSpaces Directory and write them securely.
aws_workspaces_directory (Terraform)
The Directory in WorkSpaces can be configured in Terraform with the resource name aws_workspaces_directory. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_workspaces_directory" "directory_abc" {
directory_id = local.directory_id_abc
subnet_ids = [
local.subnet_a,
local.subnet_b
]
resource "aws_workspaces_directory" "main" {
directory_id = aws_directory_service_directory.ad_directory.id
}
data "aws_workspaces_bundle" "value_windows_10" {
bundle_id = "wsb-bh8rsxt14"
resource "aws_workspaces_directory" "main" {
directory_id = data.aws_directory_service_directory.example.id
self_service_permissions {
increase_volume_size = true
rebuild_workspace = true
resource "aws_workspaces_directory" "test" {
directory_id = aws_directory_service_directory.test.id
subnet_ids = slice(module.vpc.public_subnets, 0, 2)
// デフォルトのIAMロールに依存するので depends_on を書いておく
depends_on = [
Parameters
-
aliasoptional computed - string -
customer_user_nameoptional computed - string -
directory_idrequired - string -
directory_nameoptional computed - string -
directory_typeoptional computed - string -
dns_ip_addressesoptional computed - set of string -
iam_role_idoptional computed - string -
idoptional computed - string -
ip_group_idsoptional computed - set of string -
registration_codeoptional computed - string -
subnet_idsoptional computed - set of string -
tagsoptional - map from string to string -
workspace_security_group_idoptional computed - string -
self_service_permissionslist block-
change_compute_typeoptional - bool -
increase_volume_sizeoptional - bool -
rebuild_workspaceoptional - bool -
restart_workspaceoptional - bool -
switch_running_modeoptional - bool
-
-
workspace_access_propertieslist block-
device_type_androidoptional - string -
device_type_chromeosoptional - string -
device_type_iosoptional - string -
device_type_osxoptional - string -
device_type_weboptional - string -
device_type_windowsoptional - string -
device_type_zeroclientoptional - string
-
-
workspace_creation_propertieslist block-
custom_security_group_idoptional - string -
default_ouoptional - string -
enable_internet_accessoptional - bool -
enable_maintenance_modeoptional - bool -
user_enabled_as_local_administratoroptional - bool
-
Explanation in Terraform Registry
Provides a WorkSpaces directory in AWS WorkSpaces Service.
NOTE: AWS WorkSpaces service requires
workspaces_DefaultRoleIAM role to operate normally.
AWS::WorkSpaces::Workspace (CloudFormation)
The Workspace in WorkSpaces can be configured in CloudFormation with the resource name AWS::WorkSpaces::Workspace. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
BundleIdrequired - String -
DirectoryIdrequired - String -
RootVolumeEncryptionEnabledoptional - Boolean -
Tagsoptional - List of Tag -
UserNamerequired - String -
UserVolumeEncryptionEnabledoptional - Boolean -
VolumeEncryptionKeyoptional - String -
WorkspacePropertiesoptional - WorkspaceProperties
Explanation in CloudFormation Registry
The
AWS::WorkSpaces::Workspaceresource specifies a WorkSpace.Updates are not supported for the
BundleId,RootVolumeEncryptionEnabled,UserVolumeEncryptionEnabled, orVolumeEncryptionKeyproperties. To update these properties, you must also update a property that triggers a replacement, such as theUserNameproperty.
Frequently asked questions
What is AWS WorkSpaces Directory?
AWS WorkSpaces Directory is a resource for WorkSpaces of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS WorkSpaces Directory?
For Terraform, the Rubynahal/terraform-aws-workspace-automation, colinbut1/aws-workspaces-daas and JamesWoolfenden/terraform-aws-workspaces source code examples are useful. See the Terraform Example section for further details.