Skip to main content

disks

Creates, updates, deletes or gets a disk resource or lists disks in a region

Overview

Namedisks
TypeResource
DescriptionResource Type definition for AWS::Lightsail::Disk
Idawscc.lightsail.disks

Fields

NameDatatypeDescription
disk_namestringThe names to use for your new Lightsail disk.
disk_arnstring
support_codestringSupport code to help identify any issues
availability_zonestringThe 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.
locationobjectLocation of a resource.
resource_typestringResource type of Lightsail instance.
tagsarrayAn array of key-value pairs to apply to this resource.
add_onsarrayAn array of objects representing the add-ons to enable for the new instance.
statestringState of the Lightsail disk
attachment_statestringAttachment State of the Lightsail disk
size_in_gbintegerSize of the Lightsail disk
iopsintegerIops of the Lightsail disk
is_attachedbooleanCheck is Disk is attached state
pathstringPath of the attached Disk
attached_tostringName of the attached Lightsail Instance
regionstringAWS region.

For more information, see AWS::Lightsail::Disk.

Methods

NameResourceAccessible byRequired Params
create_resourcedisksINSERTDiskName, SizeInGb, region
delete_resourcedisksDELETEIdentifier, region
update_resourcedisksUPDATEIdentifier, PatchDocument, region
list_resourcesdisks_list_onlySELECTregion
get_resourcedisksSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

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

/*+ 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
;

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:

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

lightsail:CreateDisk,
lightsail:EnableAddOn,
lightsail:DisableAddOn,
lightsail:GetDisk,
lightsail:GetDisks,
lightsail:GetRegions,
lightsail:TagResource,
lightsail:UntagResource