environments
Creates, updates, deletes, gets or lists an environments resource.
Overview
| Name | environments |
| Type | Resource |
| Id | aws.workspaces_thin_client.environments |
Fields
The following fields are returned by SELECT queries:
- get_environment
- list_environments
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the environment. (pattern: <code>[a-z0-9]{9}</code>) |
name | string | The name of the environment. (pattern: <code>$|^[0-9\p{IsAlphabetic}+:,.@'" -][0-9\p{IsAlphabetic}+=:,.@'" -]*</code>) |
activation_code | string | The activation code to register a device to the environment. (pattern: <code>[a-z]{2}[a-z0-9]{6}</code>) |
arn | string | The Amazon Resource Name (ARN) of the environment. (pattern: <code>arn:[\w+=/,.@-]+:[a-zA-Z0-9-]+:[a-zA-Z0-9-]*:[0-9]{0,12}:[a-zA-Z0-9-/._]+</code>) |
created_at | string (date-time) | The timestamp of when the environment was created. |
desired_software_set_id | string | The ID of the software set to apply. (pattern: <code>[0-9]{1,9}</code>) |
desktop_arn | string | The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Secure Browser, or AppStream 2.0. (pattern: <code>arn:[\w+=/,.@-]+:[a-zA-Z0-9-]+:[a-zA-Z0-9-]*:[0-9]{0,12}:[a-zA-Z0-9-/._]+</code>) |
desktop_endpoint | string | The URL for the identity provider login (only for environments that use AppStream 2.0). (pattern: <code>(https://)[a-z0-9]+([-.]{1}[a-z0-9]+).[a-z]{2,32}(:[0-9]{1,5})?(/.)?</code>) |
desktop_type | string | The type of streaming desktop for the environment. (workspaces, appstream, workspaces-web) |
device_creation_tags | object | The tag keys and optional values for the newly created devices for this environment. |
kms_key_arn | string | The Amazon Resource Name (ARN) of the Key Management Service key used to encrypt the environment. (pattern: <code>arn:[\w+=/,.@-]+:kms:[a-zA-Z0-9-]*:[0-9]{0,12}:key/[a-zA-Z0-9-]+</code>) |
maintenance_window | object | Describes the maintenance window for a thin client device. |
pending_software_set_id | string | The ID of the software set that is pending to be installed. (pattern: <code>[0-9]{1,9}</code>) |
pending_software_set_version | string | The version of the software set that is pending to be installed. |
registered_devices_count | integer | The number of devices registered to the environment. |
software_set_compliance_status | string | Describes if the software currently installed on all devices in the environment is a supported version. (NO_REGISTERED_DEVICES, COMPLIANT, NOT_COMPLIANT) |
software_set_update_mode | string | An option to define which software updates to apply. (USE_LATEST, USE_DESIRED) |
software_set_update_schedule | string | An option to define if software updates should be applied within a maintenance window. (USE_MAINTENANCE_WINDOW, APPLY_IMMEDIATELY) |
updated_at | string (date-time) | The timestamp of when the device was updated. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the environment. (pattern: <code>[a-z0-9]{9}</code>) |
name | string | The name of the environment. (pattern: <code>$|^[0-9\p{IsAlphabetic}+:,.@'" -][0-9\p{IsAlphabetic}+=:,.@'" -]*</code>) |
activation_code | string | The activation code to register a device to the environment. (pattern: <code>[a-z]{2}[a-z0-9]{6}</code>) |
arn | string | The Amazon Resource Name (ARN) of the environment. (pattern: <code>arn:[\w+=/,.@-]+:[a-zA-Z0-9-]+:[a-zA-Z0-9-]*:[0-9]{0,12}:[a-zA-Z0-9-/._]+</code>) |
created_at | string (date-time) | The timestamp of when the environment was created. |
desired_software_set_id | string | The ID of the software set to apply. (pattern: <code>[0-9]{1,9}</code>) |
desktop_arn | string | The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Secure Browser, or AppStream 2.0. (pattern: <code>arn:[\w+=/,.@-]+:[a-zA-Z0-9-]+:[a-zA-Z0-9-]*:[0-9]{0,12}:[a-zA-Z0-9-/._]+</code>) |
desktop_endpoint | string | The URL for the identity provider login (only for environments that use AppStream 2.0). (pattern: <code>(https://)[a-z0-9]+([-.]{1}[a-z0-9]+).[a-z]{2,32}(:[0-9]{1,5})?(/.)?</code>) |
desktop_type | string | The type of streaming desktop for the environment. (workspaces, appstream, workspaces-web) |
maintenance_window | object | Describes the maintenance window for a thin client device. |
pending_software_set_id | string | The ID of the software set that is pending to be installed. (pattern: <code>[0-9]{1,9}</code>) |
software_set_update_mode | string | An option to define which software updates to apply. (USE_LATEST, USE_DESIRED) |
software_set_update_schedule | string | An option to define if software updates should be applied within a maintenance window. (USE_MAINTENANCE_WINDOW, APPLY_IMMEDIATELY) |
updated_at | string (date-time) | The timestamp of when the device was updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_environment | select | id, region | Returns information for an environment. | |
list_environments | select | region | nextToken, maxResults | Returns a list of environments. |
create_environment | insert | region, desktopArn | Creates an environment for your thin client devices. | |
update_environment | update | id, region | Updates an environment. | |
delete_environment | delete | id, region | clientToken | Deletes an environment. |
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 |
|---|---|---|
id | string | The ID of the environment to delete. |
region | string | AWS region (default: us-east-1) |
clientToken | string | Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value. If you don't provide this value, then Amazon Web Services generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an IdempotentParameterMismatch error. |
maxResults | integer | The maximum number of results that are returned per call. You can use nextToken to obtain further pages of results. This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum. |
nextToken | string | If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error. |
SELECT examples
- get_environment
- list_environments
Returns information for an environment.
SELECT
id,
name,
activation_code,
arn,
created_at,
desired_software_set_id,
desktop_arn,
desktop_endpoint,
desktop_type,
device_creation_tags,
kms_key_arn,
maintenance_window,
pending_software_set_id,
pending_software_set_version,
registered_devices_count,
software_set_compliance_status,
software_set_update_mode,
software_set_update_schedule,
updated_at
FROM aws.workspaces_thin_client.environments
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
;
Returns a list of environments.
SELECT
id,
name,
activation_code,
arn,
created_at,
desired_software_set_id,
desktop_arn,
desktop_endpoint,
desktop_type,
maintenance_window,
pending_software_set_id,
software_set_update_mode,
software_set_update_schedule,
updated_at
FROM aws.workspaces_thin_client.environments
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_environment
- Manifest
Creates an environment for your thin client devices.
INSERT INTO aws.workspaces_thin_client.environments (
name,
desktopArn,
desktopEndpoint,
softwareSetUpdateSchedule,
maintenanceWindow,
softwareSetUpdateMode,
desiredSoftwareSetId,
kmsKeyArn,
clientToken,
tags,
deviceCreationTags,
region
)
SELECT
'{{ name }}',
'{{ desktopArn }}' /* required */,
'{{ desktopEndpoint }}',
'{{ softwareSetUpdateSchedule }}',
'{{ maintenanceWindow }}',
'{{ softwareSetUpdateMode }}',
'{{ desiredSoftwareSetId }}',
'{{ kmsKeyArn }}',
'{{ clientToken }}',
'{{ tags }}',
'{{ deviceCreationTags }}',
'{{ region }}'
RETURNING
environment
;
# Description fields are for documentation purposes
- name: environments
props:
- name: region
value: "{{ region }}"
description: Required parameter for the environments resource.
- name: name
value: "{{ name }}"
- name: desktopArn
value: "{{ desktopArn }}"
- name: desktopEndpoint
value: "{{ desktopEndpoint }}"
- name: softwareSetUpdateSchedule
value: "{{ softwareSetUpdateSchedule }}"
valid_values: ['USE_MAINTENANCE_WINDOW', 'APPLY_IMMEDIATELY']
- name: maintenanceWindow
description: |
Describes the maintenance window for a thin client device.
value:
type_: "{{ type_ }}"
startTimeHour: {{ startTimeHour }}
startTimeMinute: {{ startTimeMinute }}
endTimeHour: {{ endTimeHour }}
endTimeMinute: {{ endTimeMinute }}
daysOfTheWeek:
- "{{ daysOfTheWeek }}"
applyTimeOf: "{{ applyTimeOf }}"
- name: softwareSetUpdateMode
value: "{{ softwareSetUpdateMode }}"
valid_values: ['USE_LATEST', 'USE_DESIRED']
- name: desiredSoftwareSetId
value: "{{ desiredSoftwareSetId }}"
- name: kmsKeyArn
value: "{{ kmsKeyArn }}"
- name: clientToken
value: "{{ clientToken }}"
- name: tags
value: "{{ tags }}"
- name: deviceCreationTags
value: "{{ deviceCreationTags }}"
UPDATE examples
- update_environment
Updates an environment.
UPDATE aws.workspaces_thin_client.environments
SET
name = '{{ name }}',
desktopArn = '{{ desktopArn }}',
desktopEndpoint = '{{ desktopEndpoint }}',
softwareSetUpdateSchedule = '{{ softwareSetUpdateSchedule }}',
maintenanceWindow = '{{ maintenanceWindow }}',
softwareSetUpdateMode = '{{ softwareSetUpdateMode }}',
desiredSoftwareSetId = '{{ desiredSoftwareSetId }}',
deviceCreationTags = '{{ deviceCreationTags }}'
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required
RETURNING
environment;
DELETE examples
- delete_environment
Deletes an environment.
DELETE FROM aws.workspaces_thin_client.environments
WHERE id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
;