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
-
alias
optional computed - string -
customer_user_name
optional computed - string -
directory_id
required - string -
directory_name
optional computed - string -
directory_type
optional computed - string -
dns_ip_addresses
optional computed - set of string -
iam_role_id
optional computed - string -
id
optional computed - string -
ip_group_ids
optional computed - set of string -
registration_code
optional computed - string -
subnet_ids
optional computed - set of string -
tags
optional - map from string to string -
workspace_security_group_id
optional computed - string -
self_service_permissions
list block-
change_compute_type
optional - bool -
increase_volume_size
optional - bool -
rebuild_workspace
optional - bool -
restart_workspace
optional - bool -
switch_running_mode
optional - bool
-
-
workspace_access_properties
list block-
device_type_android
optional - string -
device_type_chromeos
optional - string -
device_type_ios
optional - string -
device_type_osx
optional - string -
device_type_web
optional - string -
device_type_windows
optional - string -
device_type_zeroclient
optional - string
-
-
workspace_creation_properties
list block-
custom_security_group_id
optional - string -
default_ou
optional - string -
enable_internet_access
optional - bool -
enable_maintenance_mode
optional - bool -
user_enabled_as_local_administrator
optional - bool
-
Explanation in Terraform Registry
Provides a WorkSpaces directory in AWS WorkSpaces Service.
NOTE: AWS WorkSpaces service requires
workspaces_DefaultRole
IAM 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
-
BundleId
required - String -
DirectoryId
required - String -
RootVolumeEncryptionEnabled
optional - Boolean -
Tags
optional - List of Tag -
UserName
required - String -
UserVolumeEncryptionEnabled
optional - Boolean -
VolumeEncryptionKey
optional - String -
WorkspaceProperties
optional - WorkspaceProperties
Explanation in CloudFormation Registry
The
AWS::WorkSpaces::Workspace
resource specifies a WorkSpace.Updates are not supported for the
BundleId
,RootVolumeEncryptionEnabled
,UserVolumeEncryptionEnabled
, orVolumeEncryptionKey
properties. To update these properties, you must also update a property that triggers a replacement, such as theUserName
property.
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.