Skip to main content

environments

Creates, updates, deletes or gets an environment resource or lists environments in a region

Overview

Nameenvironments
TypeResource
DescriptionResource type definition for AWS::WorkSpacesThinClient::Environment.
Idawscc.workspacesthinclient.environments

Fields

NameDatatypeDescription
idstringUnique identifier of the environment.
namestringThe name of the environment.
desktop_arnstringThe Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Web, or AppStream 2.0.
desktop_endpointstringThe URL for the identity provider login (only for environments that use AppStream 2.0).
desktop_typestringThe type of VDI.
activation_codestringActivation code for devices associated with environment.
registered_devices_countintegerNumber of devices registered to the environment.
software_set_update_schedulestringAn option to define if software updates should be applied within a maintenance window.
maintenance_windowobjectA specification for a time window to apply software updates.
software_set_update_modestringAn option to define which software updates to apply.
desired_software_set_idstringThe ID of the software set to apply.
pending_software_set_idstringThe ID of the software set that is pending to be installed.
pending_software_set_versionstringThe version of the software set that is pending to be installed.
software_set_compliance_statusstringDescribes if the software currently installed on all devices in the environment is a supported version.
created_atstringThe timestamp in unix epoch format when environment was created.
updated_atstringThe timestamp in unix epoch format when environment was last updated.
arnstringThe environment ARN.
kms_key_arnstringThe Amazon Resource Name (ARN) of the AWS Key Management Service key used to encrypt the environment.
tagsarrayAn array of key-value pairs to apply to this resource.
device_creation_tagsarrayAn array of key-value pairs to apply to the newly created devices for this environment.
regionstringAWS region.

For more information, see AWS::WorkSpacesThinClient::Environment.

Methods

NameResourceAccessible byRequired Params
create_resourceenvironmentsINSERTDesktopArn, region
delete_resourceenvironmentsDELETEIdentifier, region
update_resourceenvironmentsUPDATEIdentifier, PatchDocument, region
list_resourcesenvironments_list_onlySELECTregion
get_resourceenvironmentsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual environment.

SELECT
region,
id,
name,
desktop_arn,
desktop_endpoint,
desktop_type,
activation_code,
registered_devices_count,
software_set_update_schedule,
maintenance_window,
software_set_update_mode,
desired_software_set_id,
pending_software_set_id,
pending_software_set_version,
software_set_compliance_status,
created_at,
updated_at,
arn,
kms_key_arn,
tags,
device_creation_tags
FROM awscc.workspacesthinclient.environments
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';

INSERT example

Use the following StackQL query and manifest file to create a new environment resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.workspacesthinclient.environments (
DesktopArn,
region
)
SELECT
'{{ desktop_arn }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a environment resource, using stack-deploy.

/*+ update */
UPDATE awscc.workspacesthinclient.environments
SET PatchDocument = string('{{ {
"Name": name,
"DesktopEndpoint": desktop_endpoint,
"SoftwareSetUpdateSchedule": software_set_update_schedule,
"MaintenanceWindow": maintenance_window,
"SoftwareSetUpdateMode": software_set_update_mode,
"DesiredSoftwareSetId": desired_software_set_id,
"Tags": tags,
"DeviceCreationTags": device_creation_tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.workspacesthinclient.environments
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';

Permissions

To operate on the environments resource, the following permissions are required:

thinclient:CreateEnvironment,
thinclient:TagResource,
thinclient:ListTagsForResource,
appstream:DescribeStacks,
workspaces:DescribeWorkspaceDirectories,
workspaces-web:GetPortal,
workspaces-web:GetUserSettings,
kms:DescribeKey,
kms:CreateGrant,
kms:GenerateDataKey,
kms:Decrypt