instance_snapshots
Creates, updates, deletes, gets or lists an instance_snapshots resource.
Overview
| Name | instance_snapshots |
| Type | Resource |
| Id | aws.lightsail.instance_snapshots |
Fields
The following fields are returned by SELECT queries:
- get_instance_snapshot
- get_instance_snapshots
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the snapshot. (pattern: <code>\w[\w-]*\w</code>) |
arn | string | The 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_at | string (date-time) | The timestamp when the snapshot was created (1479907467.024). |
from_attached_disks | array | An array of disk objects containing information about all block storage disks. |
from_blueprint_id | string | The 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_id | string | The bundle ID from which you created the snapshot (micro_x_x). |
from_instance_arn | string | The 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_name | string | The instance from which the 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 region name and Availability Zone where you created the snapshot. |
progress | string | The progress of the snapshot. This is populated only for disk snapshots, and is null for instance snapshots. |
resource_type | string | The 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_gb | integer | The size in GB of the SSD. |
state | string | The state the snapshot is in. (pending, error, available) |
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 snapshot. (pattern: <code>\w[\w-]*\w</code>) |
arn | string | The 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_at | string (date-time) | The timestamp when the snapshot was created (1479907467.024). |
from_attached_disks | array | An array of disk objects containing information about all block storage disks. |
from_blueprint_id | string | The 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_id | string | The bundle ID from which you created the snapshot (micro_x_x). |
from_instance_arn | string | The 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_name | string | The instance from which the 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 region name and Availability Zone where you created the snapshot. |
progress | string | The progress of the snapshot. This is populated only for disk snapshots, and is null for instance snapshots. |
resource_type | string | The 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_gb | integer | The size in GB of the SSD. |
state | string | The state the snapshot is in. (pending, error, available) |
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_instance_snapshot | select | region | Returns information about a specific instance snapshot. | |
get_instance_snapshots | select | region | Returns all instance snapshots for the user's account. | |
create_instance_snapshot | insert | region, instanceSnapshotName, instanceName | 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. | |
delete_instance_snapshot | delete | region | 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. |
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_instance_snapshot
- get_instance_snapshots
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
;
Returns all instance snapshots for the user's account.
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
- create_instance_snapshot
- Manifest
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
;
# Description fields are for documentation purposes
- name: instance_snapshots
props:
- name: region
value: "{{ region }}"
description: Required parameter for the instance_snapshots resource.
- name: instanceSnapshotName
value: "{{ instanceSnapshotName }}"
description: |
The name for your new snapshot.
- name: instanceName
value: "{{ instanceName }}"
description: |
The Lightsail instance on which to base your snapshot.
- 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_instance_snapshot
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
;