Skip to main content

instance_snapshots

Creates, updates, deletes, gets or lists an instance_snapshots resource.

Overview

Nameinstance_snapshots
TypeResource
Idaws.lightsail.instance_snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the snapshot. (pattern: <code>\w[\w-]*\w</code>)
arnstringThe Amazon Resource Name (ARN) of the snapshot (arn:aws:lightsail:us-east-2:123456789101:InstanceSnapshot/d23b5706-3322-4d83-81e5-12345EXAMPLE). (pattern: <code>.\S.</code>)
created_atstring (date-time)The timestamp when the snapshot was created (1479907467.024).
from_attached_disksarrayAn array of disk objects containing information about all block storage disks.
from_blueprint_idstringThe blueprint ID from which you created the snapshot (amazon_linux_2023). A blueprint is a virtual private server (or instance) image used to create instances quickly.
from_bundle_idstringThe bundle ID from which you created the snapshot (micro_x_x).
from_instance_arnstringThe Amazon Resource Name (ARN) of the instance from which the snapshot was created (arn:aws:lightsail:us-east-2:123456789101:Instance/64b8404c-ccb1-430b-8daf-12345EXAMPLE). (pattern: <code>.\S.</code>)
from_instance_namestringThe instance from which the snapshot was created. (pattern: <code>\w[\w-]*\w</code>)
is_from_auto_snapshotbooleanA Boolean value indicating whether the snapshot was created from an automatic snapshot.
locationobjectThe region name and Availability Zone where you created the snapshot.
progressstringThe progress of the snapshot. This is populated only for disk snapshots, and is null for instance snapshots.
resource_typestringThe type of resource (usually InstanceSnapshot). (ContainerService, Instance, StaticIp, KeyPair, InstanceSnapshot, Domain, PeeredVpc, LoadBalancer, LoadBalancerTlsCertificate, Disk, DiskSnapshot, RelationalDatabase, RelationalDatabaseSnapshot, ExportSnapshotRecord, CloudFormationStackRecord, Alarm, ContactMethod, Distribution, Certificate, Bucket)
size_in_gbintegerThe size in GB of the SSD.
statestringThe state the snapshot is in. (pending, error, available)
support_codestringThe 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.
tagsarrayThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_instance_snapshotselectregionReturns information about a specific instance snapshot.
get_instance_snapshotsselectregionReturns all instance snapshots for the user's account.
create_instance_snapshotinsertregion, instanceSnapshotName, instanceNameCreates a snapshot of a specific virtual private server, or instance. You can use a snapshot to create a new instance that is based on that snapshot. The create instance snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.
delete_instance_snapshotdeleteregionDeletes a specific snapshot of a virtual private server (or instance). The delete instance snapshot operation supports tag-based access control via resource tags applied to the resource identified by instance 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about a specific instance snapshot.

SELECT
name,
arn,
created_at,
from_attached_disks,
from_blueprint_id,
from_bundle_id,
from_instance_arn,
from_instance_name,
is_from_auto_snapshot,
location,
progress,
resource_type,
size_in_gb,
state,
support_code,
tags
FROM aws.lightsail.instance_snapshots
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a snapshot of a specific virtual private server, or instance. You can use a snapshot to create a new instance that is based on that snapshot. The create instance snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

INSERT INTO aws.lightsail.instance_snapshots (
instanceSnapshotName,
instanceName,
tags,
region
)
SELECT
'{{ instanceSnapshotName }}' /* required */,
'{{ instanceName }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
operations
;

DELETE examples

Deletes a specific snapshot of a virtual private server (or instance). The delete instance snapshot operation supports tag-based access control via resource tags applied to the resource identified by instance snapshot name. For more information, see the Amazon Lightsail Developer Guide.

DELETE FROM aws.lightsail.instance_snapshots
WHERE region = '{{ region }}' --required
;