disks
Creates, updates, deletes or gets a disk resource or lists disks in a region
Overview
| Name | disks |
| Type | Resource |
| Description | Resource Type definition for AWS::Lightsail::Disk |
| Id | awscc.lightsail.disks |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
disk_name | string | The names to use for your new Lightsail disk. |
disk_arn | string | |
support_code | string | Support code to help identify any issues |
availability_zone | string | The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request. |
location | object | Location of a resource. |
resource_type | string | Resource type of Lightsail instance. |
tags | array | An array of key-value pairs to apply to this resource. |
add_ons | array | An array of objects representing the add-ons to enable for the new instance. |
state | string | State of the Lightsail disk |
attachment_state | string | Attachment State of the Lightsail disk |
size_in_gb | integer | Size of the Lightsail disk |
iops | integer | Iops of the Lightsail disk |
is_attached | boolean | Check is Disk is attached state |
path | string | Path of the attached Disk |
attached_to | string | Name of the attached Lightsail Instance |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
disk_name | string | The names to use for your new Lightsail disk. |
region | string | AWS region. |
For more information, see AWS::Lightsail::Disk.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | disks | INSERT | DiskName, SizeInGb, region |
delete_resource | disks | DELETE | Identifier, region |
update_resource | disks | UPDATE | Identifier, PatchDocument, region |
list_resources | disks_list_only | SELECT | region |
get_resource | disks | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual disk.
SELECT
region,
disk_name,
disk_arn,
support_code,
availability_zone,
location,
resource_type,
tags,
add_ons,
state,
attachment_state,
size_in_gb,
iops,
is_attached,
path,
attached_to
FROM awscc.lightsail.disks
WHERE
region = '{{ region }}' AND
Identifier = '{{ disk_name }}';
Lists all disks in a region.
SELECT
region,
disk_name
FROM awscc.lightsail.disks_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new disk resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lightsail.disks (
DiskName,
SizeInGb,
region
)
SELECT
'{{ disk_name }}',
'{{ size_in_gb }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.lightsail.disks (
DiskName,
AvailabilityZone,
Location,
Tags,
AddOns,
SizeInGb,
region
)
SELECT
'{{ disk_name }}',
'{{ availability_zone }}',
'{{ location }}',
'{{ tags }}',
'{{ add_ons }}',
'{{ size_in_gb }}',
'{{ 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: disk
props:
- name: disk_name
value: '{{ disk_name }}'
- name: availability_zone
value: '{{ availability_zone }}'
- name: location
value:
availability_zone: '{{ availability_zone }}'
region_name: '{{ region_name }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: add_ons
value:
- add_on_type: '{{ add_on_type }}'
status: '{{ status }}'
auto_snapshot_add_on_request:
snapshot_time_of_day: '{{ snapshot_time_of_day }}'
- name: size_in_gb
value: '{{ size_in_gb }}'
UPDATE example
Use the following StackQL query and manifest file to update a disk resource, using stack-deploy.
/*+ update */
UPDATE awscc.lightsail.disks
SET PatchDocument = string('{{ {
"Tags": tags,
"AddOns": add_ons
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ disk_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.lightsail.disks
WHERE
Identifier = '{{ disk_name }}' 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 disks resource, the following permissions are required:
- Create
- Read
- Delete
- List
- Update
lightsail:CreateDisk,
lightsail:EnableAddOn,
lightsail:DisableAddOn,
lightsail:GetDisk,
lightsail:GetDisks,
lightsail:GetRegions,
lightsail:TagResource,
lightsail:UntagResource
lightsail:GetDisk,
lightsail:GetDisks
lightsail:GetDisk,
lightsail:GetDisks,
lightsail:DeleteDisk
lightsail:GetDisks
lightsail:GetDisk,
lightsail:GetDisks,
lightsail:EnableAddOn,
lightsail:DisableAddOn,
lightsail:TagResource,
lightsail:UntagResource