workspace_directories
Creates, updates, deletes, gets or lists a workspace_directories resource.
Overview
| Name | workspace_directories |
| Type | Resource |
| Id | aws.workspaces.workspace_directories |
Fields
The following fields are returned by SELECT queries:
- describe_workspace_directories
| Name | Datatype | Description |
|---|---|---|
active_directory_config | object | Information about the Active Directory config. |
alias | string | The directory alias. |
certificate_based_auth_properties | object | The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory for WorkSpaces login. |
customer_user_name | string | The user name for the service account. |
directory_id | string | The directory identifier. (pattern: <code>^(d-[0-9a-f]{8,63}$)|(wsd-[0-9a-z]{8,63}$)</code>) |
directory_name | string | The name of the directory. |
directory_type | string | The directory type. (SIMPLE_AD, AD_CONNECTOR, CUSTOMER_MANAGED, AWS_IAM_IDENTITY_CENTER) |
dns_ip_addresses | array | The IP addresses of the DNS servers for the directory. |
dns_ipv_6_addresses | array | The IPv6 addresses of the DNS servers for the directory. |
endpoint_encryption_mode | string | Endpoint encryption mode that allows you to configure the specified directory between Standard TLS and FIPS 140-2 validated mode. (STANDARD_TLS, FIPS_VALIDATED) |
error_message | string | The error message returned. |
idc_config | object | Specifies details about identity center configurations. |
iam_role_id | string | The 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_config | object | Specifies details about Microsoft Entra configurations. |
registration_code | string | The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory. |
saml_properties | object | Describes 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_permissions | object | The default self-service permissions for WorkSpaces in the directory. |
state | string | The 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_properties | object | The streaming properties to configure. |
subnet_ids | array | The identifiers of the subnets used with the directory. |
tenancy | string | Specifies 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_type | string | Indicates the identity type of the specifired user. (CUSTOMER_MANAGED, AWS_DIRECTORY_SERVICE, AWS_IAM_IDENTITY_CENTER) |
workspace_access_properties | object | The devices and operating systems that users can use to access WorkSpaces. |
workspace_creation_properties | object | The default creation properties for all WorkSpaces in the directory. |
workspace_directory_description | string | The description of the WorkSpace directory (pattern: <code>^([a-zA-Z0-9_])[\a-zA-Z0-9_@#%*+=:?./!\s-]{1,255}$</code>) |
workspace_directory_name | string | The name fo the WorkSpace directory. (pattern: <code>^[a-zA-Z0-9][a-zA-Z0-9_.\s-]{1,64}$</code>) |
workspace_security_group_id | string | The identifier of the security group that is assigned to new WorkSpaces. (pattern: <code>^(sg-([0-9a-f]{8}|[0-9a-f]{17}))$</code>) |
workspace_type | string | Indicates whether the directory's WorkSpace type is personal or pools. (PERSONAL, POOLS) |
ip_group_ids | array | The identifiers of the IP access control groups associated with the directory. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_workspace_directories | select | region | Describes the available directories that are registered with Amazon WorkSpaces. | |
register_workspace_directory | insert | region | 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. | |
deregister_workspace_directory | delete | region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_workspace_directories
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
- register_workspace_directory
- Manifest
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
;
# Description fields are for documentation purposes
- name: workspace_directories
props:
- name: region
value: "{{ region }}"
description: Required parameter for the workspace_directories resource.
- name: DirectoryId
value: "{{ DirectoryId }}"
description: |
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.
- name: SubnetIds
value:
- "{{ SubnetIds }}"
description: |
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.
- name: EnableSelfService
value: {{ EnableSelfService }}
description: |
Indicates whether self-service capabilities are enabled or disabled.
- name: Tenancy
value: "{{ Tenancy }}"
description: |
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.
valid_values: ['DEDICATED', 'SHARED']
- name: Tags
description: |
The tags associated with the directory.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: WorkspaceDirectoryName
value: "{{ WorkspaceDirectoryName }}"
description: |
The name of the directory to register.
- name: WorkspaceDirectoryDescription
value: "{{ WorkspaceDirectoryDescription }}"
description: |
Description of the directory to register.
- name: UserIdentityType
value: "{{ UserIdentityType }}"
description: |
The type of identity management the user is using.
valid_values: ['CUSTOMER_MANAGED', 'AWS_DIRECTORY_SERVICE', 'AWS_IAM_IDENTITY_CENTER']
- name: IdcInstanceArn
value: "{{ IdcInstanceArn }}"
description: |
The Amazon Resource Name (ARN) of the identity center instance.
- name: MicrosoftEntraConfig
description: |
The details about Microsoft Entra config.
value:
TenantId: "{{ TenantId }}"
ApplicationConfigSecretArn: "{{ ApplicationConfigSecretArn }}"
- name: WorkspaceType
value: "{{ WorkspaceType }}"
description: |
Indicates whether the directory's WorkSpace type is personal or pools.
valid_values: ['PERSONAL', 'POOLS']
- name: ActiveDirectoryConfig
description: |
The active directory config of the directory.
value:
DomainName: "{{ DomainName }}"
ServiceAccountSecretArn: "{{ ServiceAccountSecretArn }}"
DELETE examples
- deregister_workspace_directory
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
;