disk_snapshots
Creates, updates, deletes, gets or lists a disk_snapshots resource.
Overview
| Name | disk_snapshots |
| Type | Resource |
| Id | aws.lightsail.disk_snapshots |
Fields
The following fields are returned by SELECT queries:
- get_disk_snapshot
- get_disk_snapshots
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the disk snapshot (my-disk-snapshot). (pattern: <code>\w[\w-]*\w</code>) |
arn | string | The Amazon Resource Name (ARN) of the disk snapshot. (pattern: <code>.\S.</code>) |
created_at | string (date-time) | The date when the disk snapshot was created. |
from_disk_arn | string | The Amazon Resource Name (ARN) of the source disk from which the disk snapshot was created. (pattern: <code>.\S.</code>) |
from_disk_name | string | The unique name of the source disk from which the disk snapshot was created. (pattern: <code>\w[\w-]*\w</code>) |
from_instance_arn | string | The Amazon Resource Name (ARN) of the source instance from which the disk (system volume) snapshot was created. (pattern: <code>.\S.</code>) |
from_instance_name | string | The unique name of the source instance from which the disk (system volume) snapshot was created. (pattern: <code>\w[\w-]*\w</code>) |
is_from_auto_snapshot | boolean | A Boolean value indicating whether the snapshot was created from an automatic snapshot. |
location | object | The AWS Region and Availability Zone where the disk snapshot was created. |
progress | string | The progress of the snapshot. |
resource_type | string | The Lightsail resource type (DiskSnapshot). (ContainerService, Instance, StaticIp, KeyPair, InstanceSnapshot, Domain, PeeredVpc, LoadBalancer, LoadBalancerTlsCertificate, Disk, DiskSnapshot, RelationalDatabase, RelationalDatabaseSnapshot, ExportSnapshotRecord, CloudFormationStackRecord, Alarm, ContactMethod, Distribution, Certificate, Bucket) |
size_in_gb | integer | The size of the disk in GB. |
state | string | The status of the disk snapshot operation. (pending, completed, error, unknown) |
support_code | string | The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily. |
tags | array | The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the disk snapshot (my-disk-snapshot). (pattern: <code>\w[\w-]*\w</code>) |
arn | string | The Amazon Resource Name (ARN) of the disk snapshot. (pattern: <code>.\S.</code>) |
created_at | string (date-time) | The date when the disk snapshot was created. |
from_disk_arn | string | The Amazon Resource Name (ARN) of the source disk from which the disk snapshot was created. (pattern: <code>.\S.</code>) |
from_disk_name | string | The unique name of the source disk from which the disk snapshot was created. (pattern: <code>\w[\w-]*\w</code>) |
from_instance_arn | string | The Amazon Resource Name (ARN) of the source instance from which the disk (system volume) snapshot was created. (pattern: <code>.\S.</code>) |
from_instance_name | string | The unique name of the source instance from which the disk (system volume) snapshot was created. (pattern: <code>\w[\w-]*\w</code>) |
is_from_auto_snapshot | boolean | A Boolean value indicating whether the snapshot was created from an automatic snapshot. |
location | object | The AWS Region and Availability Zone where the disk snapshot was created. |
progress | string | The progress of the snapshot. |
resource_type | string | The Lightsail resource type (DiskSnapshot). (ContainerService, Instance, StaticIp, KeyPair, InstanceSnapshot, Domain, PeeredVpc, LoadBalancer, LoadBalancerTlsCertificate, Disk, DiskSnapshot, RelationalDatabase, RelationalDatabaseSnapshot, ExportSnapshotRecord, CloudFormationStackRecord, Alarm, ContactMethod, Distribution, Certificate, Bucket) |
size_in_gb | integer | The size of the disk in GB. |
state | string | The status of the disk snapshot operation. (pending, completed, error, unknown) |
support_code | string | The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily. |
tags | array | The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_disk_snapshot | select | region | Returns information about a specific block storage disk snapshot. | |
get_disk_snapshots | select | region | Returns information about all block storage disk snapshots in your AWS account and region. | |
create_disk_snapshot | insert | region, diskSnapshotName | Creates a snapshot of a block storage disk. You can use snapshots for backups, to make copies of disks, and to save data before shutting down a Lightsail instance. You can take a snapshot of an attached disk that is in use; however, snapshots only capture data that has been written to your disk at the time the snapshot command is issued. This may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the disk long enough to take a snapshot, your snapshot should be complete. Nevertheless, if you cannot pause all file writes to the disk, you should unmount the disk from within the Lightsail instance, issue the create disk snapshot command, and then remount the disk to ensure a consistent and complete snapshot. You may remount and use your disk while the snapshot status is pending. You can also use this operation to create a snapshot of an instance's system volume. You might want to do this, for example, to recover data from the system volume of a botched instance or to create a backup of the system volume like you would for a block storage disk. To create a snapshot of a system volume, just define the instance name parameter when issuing the snapshot command, and a snapshot of the defined instance's system volume will be created. After the snapshot is available, you can create a block storage disk from the snapshot and attach it to a running instance to access the data on the disk. The create disk snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide. | |
delete_disk_snapshot | delete | region | Deletes the specified disk snapshot. When you make periodic snapshots of a disk, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will have access to all the information needed to restore the disk. The delete disk snapshot operation supports tag-based access control via resource tags applied to the resource identified by disk snapshot name. For more information, see the Amazon Lightsail Developer Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_disk_snapshot
- get_disk_snapshots
Returns information about a specific block storage disk snapshot.
SELECT
name,
arn,
created_at,
from_disk_arn,
from_disk_name,
from_instance_arn,
from_instance_name,
is_from_auto_snapshot,
location,
progress,
resource_type,
size_in_gb,
state,
support_code,
tags
FROM aws.lightsail.disk_snapshots
WHERE region = '{{ region }}' -- required
;
Returns information about all block storage disk snapshots in your AWS account and region.
SELECT
name,
arn,
created_at,
from_disk_arn,
from_disk_name,
from_instance_arn,
from_instance_name,
is_from_auto_snapshot,
location,
progress,
resource_type,
size_in_gb,
state,
support_code,
tags
FROM aws.lightsail.disk_snapshots
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_disk_snapshot
- Manifest
Creates a snapshot of a block storage disk. You can use snapshots for backups, to make copies of disks, and to save data before shutting down a Lightsail instance. You can take a snapshot of an attached disk that is in use; however, snapshots only capture data that has been written to your disk at the time the snapshot command is issued. This may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the disk long enough to take a snapshot, your snapshot should be complete. Nevertheless, if you cannot pause all file writes to the disk, you should unmount the disk from within the Lightsail instance, issue the create disk snapshot command, and then remount the disk to ensure a consistent and complete snapshot. You may remount and use your disk while the snapshot status is pending. You can also use this operation to create a snapshot of an instance's system volume. You might want to do this, for example, to recover data from the system volume of a botched instance or to create a backup of the system volume like you would for a block storage disk. To create a snapshot of a system volume, just define the instance name parameter when issuing the snapshot command, and a snapshot of the defined instance's system volume will be created. After the snapshot is available, you can create a block storage disk from the snapshot and attach it to a running instance to access the data on the disk. The create disk snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.
INSERT INTO aws.lightsail.disk_snapshots (
diskName,
diskSnapshotName,
instanceName,
tags,
region
)
SELECT
'{{ diskName }}',
'{{ diskSnapshotName }}' /* required */,
'{{ instanceName }}',
'{{ tags }}',
'{{ region }}'
RETURNING
operations
;
# Description fields are for documentation purposes
- name: disk_snapshots
props:
- name: region
value: "{{ region }}"
description: Required parameter for the disk_snapshots resource.
- name: diskName
value: "{{ diskName }}"
description: |
The unique name of the source disk (Disk-Virginia-1). This parameter cannot be defined together with the instance name parameter. The disk name and instance name parameters are mutually exclusive.
- name: diskSnapshotName
value: "{{ diskSnapshotName }}"
description: |
The name of the destination disk snapshot (my-disk-snapshot) based on the source disk.
- name: instanceName
value: "{{ instanceName }}"
description: |
The unique name of the source instance (Amazon_Linux-512MB-Virginia-1). When this is defined, a snapshot of the instance's system volume is created. This parameter cannot be defined together with the disk name parameter. The instance name and disk name parameters are mutually exclusive.
- name: tags
description: |
The tag keys and optional values to add to the resource during create. Use the TagResource action to tag a resource after it's created.
value:
- key: "{{ key }}"
value: "{{ value }}"
DELETE examples
- delete_disk_snapshot
Deletes the specified disk snapshot. When you make periodic snapshots of a disk, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will have access to all the information needed to restore the disk. The delete disk snapshot operation supports tag-based access control via resource tags applied to the resource identified by disk snapshot name. For more information, see the Amazon Lightsail Developer Guide.
DELETE FROM aws.lightsail.disk_snapshots
WHERE region = '{{ region }}' --required
;