Skip to main content

workspace_directories

Creates, updates, deletes, gets or lists a workspace_directories resource.

Overview

Nameworkspace_directories
TypeResource
Idaws.workspaces.workspace_directories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
active_directory_configobjectInformation about the Active Directory config.
aliasstringThe directory alias.
certificate_based_auth_propertiesobjectThe certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory for WorkSpaces login.
customer_user_namestringThe user name for the service account.
directory_idstringThe directory identifier. (pattern: <code>^(d-[0-9a-f]{8,63}$)|(wsd-[0-9a-z]{8,63}$)</code>)
directory_namestringThe name of the directory.
directory_typestringThe directory type. (SIMPLE_AD, AD_CONNECTOR, CUSTOMER_MANAGED, AWS_IAM_IDENTITY_CENTER)
dns_ip_addressesarrayThe IP addresses of the DNS servers for the directory.
dns_ipv_6_addressesarrayThe IPv6 addresses of the DNS servers for the directory.
endpoint_encryption_modestringEndpoint encryption mode that allows you to configure the specified directory between Standard TLS and FIPS 140-2 validated mode. (STANDARD_TLS, FIPS_VALIDATED)
error_messagestringThe error message returned.
idc_configobjectSpecifies details about identity center configurations.
iam_role_idstringThe 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. (pattern: <code>^arn:aws[a-z-]{0,7}:[A-Za-z0-9][A-za-z0-9_/.-]{0,62}:[A-za-z0-9_/.-]{0,63}:[A-za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\-]{0,1023}$</code>)
microsoft_entra_configobjectSpecifies details about Microsoft Entra configurations.
registration_codestringThe registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.
saml_propertiesobjectDescribes the enablement status, user access URL, and relay state parameter name that are used for configuring federation with an SAML 2.0 identity provider.
selfservice_permissionsobjectThe default self-service permissions for WorkSpaces in the directory.
statestringThe state of the directory's registration with Amazon WorkSpaces. After a directory is deregistered, the DEREGISTERED state is returned very briefly before the directory metadata is cleaned up, so this state is rarely returned. To confirm that a directory is deregistered, check for the directory ID by using DescribeWorkspaceDirectories. If the directory ID isn't returned, then the directory has been successfully deregistered. (REGISTERING, REGISTERED, DEREGISTERING, DEREGISTERED, ERROR)
streaming_propertiesobjectThe streaming properties to configure.
subnet_idsarrayThe identifiers of the subnets used with the directory.
tenancystringSpecifies whether the directory is dedicated or shared. To use Bring Your Own License (BYOL), this value must be set to DEDICATED. For more information, see Bring Your Own Windows Desktop Images. (DEDICATED, SHARED)
user_identity_typestringIndicates the identity type of the specifired user. (CUSTOMER_MANAGED, AWS_DIRECTORY_SERVICE, AWS_IAM_IDENTITY_CENTER)
workspace_access_propertiesobjectThe devices and operating systems that users can use to access WorkSpaces.
workspace_creation_propertiesobjectThe default creation properties for all WorkSpaces in the directory.
workspace_directory_descriptionstringThe description of the WorkSpace directory (pattern: <code>^([a-zA-Z0-9_])[\a-zA-Z0-9_@#%*+=:?./!\s-]{1,255}$</code>)
workspace_directory_namestringThe name fo the WorkSpace directory. (pattern: <code>^[a-zA-Z0-9][a-zA-Z0-9_.\s-]{1,64}$</code>)
workspace_security_group_idstringThe identifier of the security group that is assigned to new WorkSpaces. (pattern: <code>^(sg-([0-9a-f]{8}|[0-9a-f]{17}))$</code>)
workspace_typestringIndicates whether the directory's WorkSpace type is personal or pools. (PERSONAL, POOLS)
ip_group_idsarrayThe identifiers of the IP access control groups associated with the directory.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_workspace_directoriesselectregionDescribes the available directories that are registered with Amazon WorkSpaces.
register_workspace_directoryinsertregionRegisters 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.
deregister_workspace_directorydeleteregionDeregisters the specified directory. This operation is asynchronous and returns before the WorkSpace directory is deregistered. If any WorkSpaces are registered to this directory, you must remove them before you can deregister the directory. Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. If there are no WorkSpaces being used with your Simple AD or AD Connector directory for 30 consecutive days, this directory will be automatically deregistered for use with Amazon WorkSpaces, and you will be charged for this directory as per the Directory Service pricing terms. To delete empty directories, see Delete the Directory for Your WorkSpaces. If you delete your Simple AD or AD Connector directory, you can always create a new one when you want to start using WorkSpaces again.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Describes the available directories that are registered with Amazon WorkSpaces.

SELECT
active_directory_config,
alias,
certificate_based_auth_properties,
customer_user_name,
directory_id,
directory_name,
directory_type,
dns_ip_addresses,
dns_ipv_6_addresses,
endpoint_encryption_mode,
error_message,
idc_config,
iam_role_id,
microsoft_entra_config,
registration_code,
saml_properties,
selfservice_permissions,
state,
streaming_properties,
subnet_ids,
tenancy,
user_identity_type,
workspace_access_properties,
workspace_creation_properties,
workspace_directory_description,
workspace_directory_name,
workspace_security_group_id,
workspace_type,
ip_group_ids
FROM aws.workspaces.workspace_directories
WHERE region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.workspaces.workspace_directories (
DirectoryId,
SubnetIds,
EnableSelfService,
Tenancy,
Tags,
WorkspaceDirectoryName,
WorkspaceDirectoryDescription,
UserIdentityType,
IdcInstanceArn,
MicrosoftEntraConfig,
WorkspaceType,
ActiveDirectoryConfig,
region
)
SELECT
'{{ DirectoryId }}',
'{{ SubnetIds }}',
{{ EnableSelfService }},
'{{ Tenancy }}',
'{{ Tags }}',
'{{ WorkspaceDirectoryName }}',
'{{ WorkspaceDirectoryDescription }}',
'{{ UserIdentityType }}',
'{{ IdcInstanceArn }}',
'{{ MicrosoftEntraConfig }}',
'{{ WorkspaceType }}',
'{{ ActiveDirectoryConfig }}',
'{{ region }}'
RETURNING
directory_id,
state
;

DELETE examples

Deregisters the specified directory. This operation is asynchronous and returns before the WorkSpace directory is deregistered. If any WorkSpaces are registered to this directory, you must remove them before you can deregister the directory. Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. If there are no WorkSpaces being used with your Simple AD or AD Connector directory for 30 consecutive days, this directory will be automatically deregistered for use with Amazon WorkSpaces, and you will be charged for this directory as per the Directory Service pricing terms. To delete empty directories, see Delete the Directory for Your WorkSpaces. If you delete your Simple AD or AD Connector directory, you can always create a new one when you want to start using WorkSpaces again.

DELETE FROM aws.workspaces.workspace_directories
WHERE region = '{{ region }}' --required
;