RegisterWorkspaceDirectory - Amazon WorkSpaces Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

RegisterWorkspaceDirectory

Registers the specified directory. This operation is asynchronous and returns before the WorkSpace directory is registered. If this is the first time you are registering a directory, you will need to create the workspaces_DefaultRole role before you can register a directory. For more information, see Creating the workspaces_DefaultRole Role.

Request Syntax

{ "DirectoryId": "string", "EnableSelfService": boolean, "EnableWorkDocs": boolean, "SubnetIds": [ "string" ], "Tags": [ { "Key": "string", "Value": "string" } ], "Tenancy": "string" }

Request Parameters

The request accepts the following data in JSON format.

DirectoryId

The identifier of the directory. You cannot register a directory if it does not have a status of Active. If the directory does not have a status of Active, you will receive an InvalidResourceStateException error. If you have already registered the maximum number of directories that you can register with Amazon WorkSpaces, you will receive a ResourceLimitExceededException error. Deregister directories that you are not using for WorkSpaces, and try again.

Type: String

Length Constraints: Minimum length of 10. Maximum length of 65.

Pattern: ^d-[0-9a-f]{8,63}$

Required: Yes

EnableSelfService

Indicates whether self-service capabilities are enabled or disabled.

Type: Boolean

Required: No

EnableWorkDocs

Indicates whether Amazon WorkDocs is enabled or disabled. If you have enabled this parameter and WorkDocs is not available in the Region, you will receive an OperationNotSupportedException error. Set EnableWorkDocs to disabled, and try again.

Type: Boolean

Required: Yes

SubnetIds

The identifiers of the subnets for your virtual private cloud (VPC). Make sure that the subnets are in supported Availability Zones. The subnets must also be in separate Availability Zones. If these conditions are not met, you will receive an OperationNotSupportedException error.

Type: Array of strings

Array Members: Maximum number of 2 items.

Length Constraints: Minimum length of 15. Maximum length of 24.

Pattern: ^(subnet-([0-9a-f]{8}|[0-9a-f]{17}))$

Required: No

Tags

The tags associated with the directory.

Type: Array of Tag objects

Required: No

Tenancy

Indicates whether your WorkSpace directory is dedicated or shared. To use Bring Your Own License (BYOL) images, this value must be set to DEDICATED and your Amazon Web Services account must be enabled for BYOL. If your account has not been enabled for BYOL, you will receive an InvalidParameterValuesException error. For more information about BYOL images, see Bring Your Own Windows Desktop Images.

Type: String

Valid Values: DEDICATED | SHARED

Required: No

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

The user is not authorized to access a resource.

HTTP Status Code: 400

InvalidParameterValuesException

One or more parameter values are not valid.

HTTP Status Code: 400

InvalidResourceStateException

The state of the resource is not valid for this operation.

HTTP Status Code: 400

OperationNotSupportedException

This operation is not supported.

HTTP Status Code: 400

ResourceLimitExceededException

Your resource limits have been exceeded.

HTTP Status Code: 400

ResourceNotFoundException

The resource could not be found.

HTTP Status Code: 400

UnsupportedNetworkConfigurationException

The configuration of this network is not supported for this operation, or your network configuration conflicts with the Amazon WorkSpaces management network IP range. For more information, see Configure a VPC for Amazon WorkSpaces.

HTTP Status Code: 400

WorkspacesDefaultRoleNotFoundException

The workspaces_DefaultRole role could not be found. If this is the first time you are registering a directory, you will need to create the workspaces_DefaultRole role before you can register a directory. For more information, see Creating the workspaces_DefaultRole Role.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: