environments
Creates, updates, deletes or gets an environment resource or lists environments in a region
Overview
| Name | environments |
| Type | Resource |
| Description | Resource type definition for AWS::WorkSpacesThinClient::Environment. |
| Id | awscc.workspacesthinclient.environments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier of the environment. |
name | string | The name of the environment. |
desktop_arn | string | The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Web, or AppStream 2.0. |
desktop_endpoint | string | The URL for the identity provider login (only for environments that use AppStream 2.0). |
desktop_type | string | The type of VDI. |
activation_code | string | Activation code for devices associated with environment. |
registered_devices_count | integer | Number of devices registered to the environment. |
software_set_update_schedule | string | An option to define if software updates should be applied within a maintenance window. |
maintenance_window | object | A specification for a time window to apply software updates. |
software_set_update_mode | string | An option to define which software updates to apply. |
desired_software_set_id | string | The ID of the software set to apply. |
pending_software_set_id | string | The ID of the software set that is pending to be installed. |
pending_software_set_version | string | The version of the software set that is pending to be installed. |
software_set_compliance_status | string | Describes if the software currently installed on all devices in the environment is a supported version. |
created_at | string | The timestamp in unix epoch format when environment was created. |
updated_at | string | The timestamp in unix epoch format when environment was last updated. |
arn | string | The environment ARN. |
kms_key_arn | string | The Amazon Resource Name (ARN) of the AWS Key Management Service key used to encrypt the environment. |
tags | array | An array of key-value pairs to apply to this resource. |
device_creation_tags | array | An array of key-value pairs to apply to the newly created devices for this environment. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier of the environment. |
region | string | AWS region. |
For more information, see AWS::WorkSpacesThinClient::Environment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | environments | INSERT | DesktopArn, region |
delete_resource | environments | DELETE | Identifier, region |
update_resource | environments | UPDATE | Identifier, PatchDocument, region |
list_resources | environments_list_only | SELECT | region |
get_resource | environments | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all environments in a region.
SELECT
region,
id
FROM awscc.workspacesthinclient.environments_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new environment resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.workspacesthinclient.environments (
DesktopArn,
region
)
SELECT
'{{ desktop_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.workspacesthinclient.environments (
Name,
DesktopArn,
DesktopEndpoint,
SoftwareSetUpdateSchedule,
MaintenanceWindow,
SoftwareSetUpdateMode,
DesiredSoftwareSetId,
KmsKeyArn,
Tags,
DeviceCreationTags,
region
)
SELECT
'{{ name }}',
'{{ desktop_arn }}',
'{{ desktop_endpoint }}',
'{{ software_set_update_schedule }}',
'{{ maintenance_window }}',
'{{ software_set_update_mode }}',
'{{ desired_software_set_id }}',
'{{ kms_key_arn }}',
'{{ tags }}',
'{{ device_creation_tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: environment
props:
- name: name
value: '{{ name }}'
- name: desktop_arn
value: '{{ desktop_arn }}'
- name: desktop_endpoint
value: '{{ desktop_endpoint }}'
- name: software_set_update_schedule
value: '{{ software_set_update_schedule }}'
- name: maintenance_window
value:
type: '{{ type }}'
start_time_hour: '{{ start_time_hour }}'
start_time_minute: '{{ start_time_minute }}'
end_time_hour: null
end_time_minute: null
days_of_the_week:
- '{{ days_of_the_week[0] }}'
apply_time_of: '{{ apply_time_of }}'
- name: software_set_update_mode
value: '{{ software_set_update_mode }}'
- name: desired_software_set_id
value: '{{ desired_software_set_id }}'
- name: kms_key_arn
value: '{{ kms_key_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: device_creation_tags
value:
- null
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.workspacesthinclient.environments
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the environments resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
thinclient:CreateEnvironment,
thinclient:TagResource,
thinclient:ListTagsForResource,
appstream:DescribeStacks,
workspaces:DescribeWorkspaceDirectories,
workspaces-web:GetPortal,
workspaces-web:GetUserSettings,
kms:DescribeKey,
kms:CreateGrant,
kms:GenerateDataKey,
kms:Decrypt
thinclient:GetEnvironment,
thinclient:ListTagsForResource,
kms:Decrypt
appstream:DescribeStacks,
workspaces:DescribeWorkspaceDirectories,
workspaces-web:GetPortal,
workspaces-web:GetUserSettings,
thinclient:UpdateEnvironment,
thinclient:TagResource,
thinclient:UntagResource,
kms:Decrypt,
kms:GenerateDataKey
thinclient:DeleteEnvironment,
thinclient:UntagResource,
kms:Decrypt,
kms:RetireGrant
thinclient:ListEnvironments,
thinclient:ListTagsForResource,
kms:Decrypt