volumes
Creates, updates, deletes or gets a volume resource or lists volumes in a region
Overview
| Name | volumes |
| Type | Resource |
| Description | Resource Type definition for AWS::WorkspacesInstances::Volume - Manages WorkSpaces Volume resources |
| Id | awscc.workspacesinstances.volumes |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
volume_id | string | Unique identifier for the volume |
availability_zone | string | The Availability Zone in which to create the volume |
encrypted | boolean | Indicates whether the volume should be encrypted |
iops | integer | The number of I/O operations per second (IOPS) |
kms_key_id | string | The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for Amazon EBS encryption |
size_in_gb | integer | The size of the volume, in GiBs |
snapshot_id | string | The snapshot from which to create the volume |
throughput | integer | The throughput to provision for a volume, with a maximum of 1,000 MiB/s |
volume_type | string | The volume type |
tag_specifications | array | The tags passed to EBS volume |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
volume_id | string | Unique identifier for the volume |
region | string | AWS region. |
For more information, see AWS::WorkspacesInstances::Volume.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | volumes | INSERT | AvailabilityZone, region |
delete_resource | volumes | DELETE | Identifier, region |
list_resources | volumes_list_only | SELECT | region |
get_resource | volumes | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual volume.
SELECT
region,
volume_id,
availability_zone,
encrypted,
iops,
kms_key_id,
size_in_gb,
snapshot_id,
throughput,
volume_type,
tag_specifications
FROM awscc.workspacesinstances.volumes
WHERE
region = '{{ region }}' AND
Identifier = '{{ volume_id }}';
Lists all volumes in a region.
SELECT
region,
volume_id
FROM awscc.workspacesinstances.volumes_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new volume resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.workspacesinstances.volumes (
AvailabilityZone,
region
)
SELECT
'{{ availability_zone }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.workspacesinstances.volumes (
AvailabilityZone,
Encrypted,
Iops,
KmsKeyId,
SizeInGB,
SnapshotId,
Throughput,
VolumeType,
TagSpecifications,
region
)
SELECT
'{{ availability_zone }}',
'{{ encrypted }}',
'{{ iops }}',
'{{ kms_key_id }}',
'{{ size_in_gb }}',
'{{ snapshot_id }}',
'{{ throughput }}',
'{{ volume_type }}',
'{{ tag_specifications }}',
'{{ 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: volume
props:
- name: availability_zone
value: '{{ availability_zone }}'
- name: encrypted
value: '{{ encrypted }}'
- name: iops
value: '{{ iops }}'
- name: kms_key_id
value: '{{ kms_key_id }}'
- name: size_in_gb
value: '{{ size_in_gb }}'
- name: snapshot_id
value: '{{ snapshot_id }}'
- name: throughput
value: '{{ throughput }}'
- name: volume_type
value: '{{ volume_type }}'
- name: tag_specifications
value:
- resource_type: '{{ resource_type }}'
tags:
- key: '{{ key }}'
value: '{{ value }}'
DELETE example
/*+ delete */
DELETE FROM awscc.workspacesinstances.volumes
WHERE
Identifier = '{{ volume_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 volumes resource, the following permissions are required:
- Create
- Read
- Delete
- List
workspaces-instances:CreateVolume,
ec2:CreateVolume,
ec2:CreateTags
ec2:DescribeVolumes
workspaces-instances:DeleteVolume,
ec2:DescribeVolumes,
ec2:DeleteVolume
ec2:DescribeVolumes