Skip to main content

environments

Creates, updates, deletes, gets or lists an environments resource.

Overview

Nameenvironments
TypeResource
Idaws.workspaces_thin_client.environments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the environment. (pattern: <code>[a-z0-9]{9}</code>)
namestringThe name of the environment. (pattern: <code>$|^[0-9\p{IsAlphabetic}+:,.@'" -][0-9\p{IsAlphabetic}+=:,.@'" -]*</code>)
activation_codestringThe activation code to register a device to the environment. (pattern: <code>[a-z]{2}[a-z0-9]{6}</code>)
arnstringThe 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_atstring (date-time)The timestamp of when the environment was created.
desired_software_set_idstringThe ID of the software set to apply. (pattern: <code>[0-9]{1,9}</code>)
desktop_arnstringThe 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_endpointstringThe 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_typestringThe type of streaming desktop for the environment. (workspaces, appstream, workspaces-web)
device_creation_tagsobjectThe tag keys and optional values for the newly created devices for this environment.
kms_key_arnstringThe 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_windowobjectDescribes the maintenance window for a thin client device.
pending_software_set_idstringThe ID of the software set that is pending to be installed. (pattern: <code>[0-9]{1,9}</code>)
pending_software_set_versionstringThe version of the software set that is pending to be installed.
registered_devices_countintegerThe number of devices registered to the environment.
software_set_compliance_statusstringDescribes if the software currently installed on all devices in the environment is a supported version. (NO_REGISTERED_DEVICES, COMPLIANT, NOT_COMPLIANT)
software_set_update_modestringAn option to define which software updates to apply. (USE_LATEST, USE_DESIRED)
software_set_update_schedulestringAn option to define if software updates should be applied within a maintenance window. (USE_MAINTENANCE_WINDOW, APPLY_IMMEDIATELY)
updated_atstring (date-time)The timestamp of when the device was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_environmentselectid, regionReturns information for an environment.
list_environmentsselectregionnextToken, maxResultsReturns a list of environments.
create_environmentinsertregion, desktopArnCreates an environment for your thin client devices.
update_environmentupdateid, regionUpdates an environment.
delete_environmentdeleteid, regionclientTokenDeletes 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.

NameDatatypeDescription
idstringThe ID of the environment to delete.
regionstringAWS region (default: us-east-1)
clientTokenstringSpecifies 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.
maxResultsintegerThe 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.
nextTokenstringIf 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

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
;

INSERT examples

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
;

UPDATE examples

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

Deletes an environment.

DELETE FROM aws.workspaces_thin_client.environments
WHERE id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
;