Skip to main content

instance_snapshots

Creates, updates, deletes or gets an instance_snapshot resource or lists instance_snapshots in a region

Overview

Nameinstance_snapshots
TypeResource
DescriptionResource Type definition for AWS::Lightsail::InstanceSnapshot
Idawscc.lightsail.instance_snapshots

Fields

NameDatatypeDescription
instance_snapshot_namestringThe name of the snapshot.
arnstringThe Amazon Resource Name (ARN) of the snapshot.
instance_namestringThe instance from which the snapshot was created.
resource_typestringThe type of resource (usually InstanceSnapshot).
statestringThe state the snapshot is in.
from_instance_namestringThe instance from which the snapshot was created.
from_instance_arnstringThe Amazon Resource Name (ARN) of the instance from which the snapshot was created.
size_in_gbintegerThe size in GB of the SSD
is_from_auto_snapshotbooleanA Boolean value indicating whether the snapshot was created from an automatic snapshot.
support_codestringSupport code to help identify any issues
locationobjectThe region name and Availability Zone where you created the snapshot.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourceinstance_snapshotsINSERTInstanceSnapshotName, InstanceName, region
delete_resourceinstance_snapshotsDELETEIdentifier, region
update_resourceinstance_snapshotsUPDATEIdentifier, PatchDocument, region
list_resourcesinstance_snapshots_list_onlySELECTregion
get_resourceinstance_snapshotsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual instance_snapshot.

SELECT
region,
instance_snapshot_name,
arn,
instance_name,
resource_type,
state,
from_instance_name,
from_instance_arn,
size_in_gb,
is_from_auto_snapshot,
support_code,
location,
tags
FROM awscc.lightsail.instance_snapshots
WHERE
region = '{{ region }}' AND
Identifier = '{{ instance_snapshot_name }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.lightsail.instance_snapshots (
InstanceSnapshotName,
InstanceName,
region
)
SELECT
'{{ instance_snapshot_name }}',
'{{ instance_name }}',
'{{ 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 instance_snapshot resource, using stack-deploy.

/*+ update */
UPDATE awscc.lightsail.instance_snapshots
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ instance_snapshot_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.lightsail.instance_snapshots
WHERE
Identifier = '{{ instance_snapshot_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 instance_snapshots resource, the following permissions are required:

lightsail:CreateInstanceSnapshot,
lightsail:GetInstanceSnapshot,
lightsail:TagResource