Skip to main content

volume_associations

Creates, updates, deletes or gets a volume_association resource or lists volume_associations in a region

Overview

Namevolume_associations
TypeResource
DescriptionResource Type definition for AWS::WorkspacesInstances::VolumeAssociation
Idawscc.workspacesinstances.volume_associations

Fields

NameDatatypeDescription
workspace_instance_idstringID of the workspace instance to associate with the volume
volume_idstringID of the volume to attach to the workspace instance
devicestringThe device name for the volume attachment
disassociate_modestringMode to use when disassociating the volume
regionstringAWS region.

For more information, see AWS::WorkspacesInstances::VolumeAssociation.

Methods

NameResourceAccessible byRequired Params
create_resourcevolume_associationsINSERTWorkspaceInstanceId, VolumeId, Device, region
delete_resourcevolume_associationsDELETEIdentifier, region
list_resourcesvolume_associations_list_onlySELECTregion
get_resourcevolume_associationsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual volume_association.

SELECT
region,
workspace_instance_id,
volume_id,
device,
disassociate_mode
FROM awscc.workspacesinstances.volume_associations
WHERE
region = '{{ region }}' AND
Identifier = '{{ workspace_instance_id }}|{{ volume_id }}|{{ device }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.workspacesinstances.volume_associations (
WorkspaceInstanceId,
VolumeId,
Device,
region
)
SELECT
'{{ workspace_instance_id }}',
'{{ volume_id }}',
'{{ device }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.workspacesinstances.volume_associations
WHERE
Identifier = '{{ workspace_instance_id }}|{{ volume_id }}|{{ device }}' 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:

ParameterDescription
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 volume_associations resource, the following permissions are required:

ec2:DescribeVolumes,
ec2:AttachVolume,
workspaces-instances:GetWorkspaceInstance,
workspaces-instances:AssociateVolume