workspace_instances
Creates, updates, deletes or gets a workspace_instance resource or lists workspace_instances in a region
Overview
| Name | workspace_instances |
| Type | Resource |
| Description | Resource Type definition for AWS::WorkspacesInstances::WorkspaceInstance |
| Id | awscc.workspacesinstances.workspace_instances |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
managed_instance | object | |
tags | array | |
workspace_instance_id | string | Unique identifier for the workspace instance |
provision_state | string | The current state of the workspace instance |
e_c2_managed_instance | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
workspace_instance_id | string | Unique identifier for the workspace instance |
region | string | AWS region. |
For more information, see AWS::WorkspacesInstances::WorkspaceInstance.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | workspace_instances | INSERT | , region |
delete_resource | workspace_instances | DELETE | Identifier, region |
update_resource | workspace_instances | UPDATE | Identifier, PatchDocument, region |
list_resources | workspace_instances_list_only | SELECT | region |
get_resource | workspace_instances | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual workspace_instance.
SELECT
region,
managed_instance,
tags,
workspace_instance_id,
provision_state,
e_c2_managed_instance
FROM awscc.workspacesinstances.workspace_instances
WHERE
region = '{{ region }}' AND
Identifier = '{{ workspace_instance_id }}';
Lists all workspace_instances in a region.
SELECT
region,
workspace_instance_id
FROM awscc.workspacesinstances.workspace_instances_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new workspace_instance resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.workspacesinstances.workspace_instances (
,
region
)
SELECT
'{{ }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.workspacesinstances.workspace_instances (
ManagedInstance,
Tags,
region
)
SELECT
'{{ managed_instance }}',
'{{ 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: workspace_instance
props:
- name: managed_instance
value:
block_device_mappings:
- device_name: '{{ device_name }}'
ebs:
volume_type: '{{ volume_type }}'
encrypted: '{{ encrypted }}'
kms_key_id: '{{ kms_key_id }}'
iops: '{{ iops }}'
throughput: '{{ throughput }}'
volume_size: '{{ volume_size }}'
no_device: '{{ no_device }}'
virtual_name: '{{ virtual_name }}'
capacity_reservation_specification:
capacity_reservation_preference: '{{ capacity_reservation_preference }}'
capacity_reservation_target:
capacity_reservation_id: '{{ capacity_reservation_id }}'
capacity_reservation_resource_group_arn: '{{ capacity_reservation_resource_group_arn }}'
cpu_options:
core_count: '{{ core_count }}'
threads_per_core: '{{ threads_per_core }}'
credit_specification:
cpu_credits: '{{ cpu_credits }}'
disable_api_stop: '{{ disable_api_stop }}'
ebs_optimized: '{{ ebs_optimized }}'
enable_primary_ipv6: '{{ enable_primary_ipv6 }}'
enclave_options:
enabled: '{{ enabled }}'
hibernation_options:
configured: '{{ configured }}'
iam_instance_profile:
arn: '{{ arn }}'
name: '{{ name }}'
image_id: '{{ image_id }}'
instance_market_options:
market_type: '{{ market_type }}'
spot_options:
instance_interruption_behavior: '{{ instance_interruption_behavior }}'
max_price: '{{ max_price }}'
spot_instance_type: '{{ spot_instance_type }}'
valid_until_utc: '{{ valid_until_utc }}'
instance_type: '{{ instance_type }}'
ipv6_address_count: '{{ ipv6_address_count }}'
key_name: '{{ key_name }}'
license_specifications:
- license_configuration_arn: '{{ license_configuration_arn }}'
maintenance_options:
auto_recovery: '{{ auto_recovery }}'
metadata_options:
http_endpoint: '{{ http_endpoint }}'
http_protocol_ipv6: '{{ http_protocol_ipv6 }}'
http_put_response_hop_limit: '{{ http_put_response_hop_limit }}'
http_tokens: '{{ http_tokens }}'
instance_metadata_tags: '{{ instance_metadata_tags }}'
monitoring:
enabled: '{{ enabled }}'
network_interfaces:
- description: '{{ description }}'
device_index: '{{ device_index }}'
groups:
- '{{ groups[0] }}'
subnet_id: '{{ subnet_id }}'
network_performance_options:
bandwidth_weighting: '{{ bandwidth_weighting }}'
placement:
availability_zone: '{{ availability_zone }}'
group_id: '{{ group_id }}'
group_name: '{{ group_name }}'
partition_number: '{{ partition_number }}'
tenancy: '{{ tenancy }}'
private_dns_name_options:
hostname_type: '{{ hostname_type }}'
enable_resource_name_dns_arecord: '{{ enable_resource_name_dns_arecord }}'
enable_resource_name_dns_aa_aa_record: '{{ enable_resource_name_dns_aa_aa_record }}'
subnet_id: '{{ subnet_id }}'
tag_specifications:
- resource_type: '{{ resource_type }}'
tags:
- key: '{{ key }}'
value: '{{ value }}'
user_data: '{{ user_data }}'
- name: tags
value:
- null
UPDATE example
Use the following StackQL query and manifest file to update a workspace_instance resource, using stack-deploy.
/*+ update */
UPDATE awscc.workspacesinstances.workspace_instances
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ workspace_instance_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.workspacesinstances.workspace_instances
WHERE
Identifier = '{{ workspace_instance_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 workspace_instances resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
workspaces-instances:CreateWorkspaceInstance,
workspaces-instances:GetWorkspaceInstance,
workspaces-instances:TagResource,
ec2:RunInstances,
ec2:DescribeInstances,
ec2:DescribeInstanceStatus,
ec2:CreateTags,
iam:PassRole
workspaces-instances:GetWorkspaceInstance,
workspaces-instances:ListTagsForResource
workspaces-instances:TagResource,
workspaces-instances:UntagResource,
workspaces-instances:ListTagsForResource,
workspaces-instances:GetWorkspaceInstance
workspaces-instances:DeleteWorkspaceInstance,
workspaces-instances:GetWorkspaceInstance,
ec2:TerminateInstances,
ec2:DescribeInstances,
ec2:DescribeInstanceStatus
workspaces-instances:ListWorkspaceInstances