» Resource: aws_workspace

Provides a workspace in AWS Workspaces Service

» Example Usage

data "aws_workspaces_directory" "main" {
  directory_id = "d-ten5h0y19"
}

data "aws_workspaces_bundle" "value_windows_10" {
  bundle_id = "wsb-bh8rsxt14" # Value with Windows 10 (English)
}

resource "aws_workspaces_workspace" "jhon.doe" {
  directory_id = "${data.aws_workspaces_directory.main.id}"
  bundle_id    = "${data.aws_workspaces_bundle.value_windows_10.id}"
  user_name    = "jhon.doe"

  root_volume_encryption_enabled = true
  user_volume_encryption_enabled = true
  volume_encryption_key          = "aws/workspaces"

  workspace_properties {
    compute_type_name                         = "VALUE"
    user_volume_size_gib                      = 10
    root_volume_size_gib                      = 80
    running_mode                              = "AUTO_STOP"
    running_mode_auto_stop_timeout_in_minutes = 60
  }

  tags = {
    Department = "IT"
  }
}

» Argument Reference

The following arguments are supported:

  • directory_id - (Required) The ID of the directory for the WorkSpace.
  • bundle_id - (Required) The ID of the bundle for the WorkSpace.
  • user_name – (Required) The user name of the user for the WorkSpace. This user name must exist in the directory for the WorkSpace.
  • root_volume_encryption_enabled - (Optional) Indicates whether the data stored on the root volume is encrypted.
  • user_volume_encryption_enabled – (Optional) Indicates whether the data stored on the user volume is encrypted.
  • volume_encryption_key – (Optional) The symmetric AWS KMS customer master key (CMK) used to encrypt data stored on your WorkSpace. Amazon WorkSpaces does not support asymmetric CMKs.
  • tags - (Optional) The tags for the WorkSpace.
  • workspace_properties – (Optional) The WorkSpace properties.

workspace_properties supports the following:

» Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The workspaces ID.
  • ip_address - The IP address of the WorkSpace.
  • computer_name - The name of the WorkSpace, as seen by the operating system.
  • state - The operational state of the WorkSpace.

» Import

Workspaces can be imported using their ID, e.g.

$ terraform import aws_workspaces_workspace.example ws-9z9zmbkhv