instance_snapshots
Creates, updates, deletes or gets an instance_snapshot resource or lists instance_snapshots in a region
Overview
| Name | instance_snapshots |
| Type | Resource |
| Description | Resource Type definition for AWS::Lightsail::InstanceSnapshot |
| Id | awscc.lightsail.instance_snapshots |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
instance_snapshot_name | string | The name of the snapshot. |
arn | string | The Amazon Resource Name (ARN) of the snapshot. |
instance_name | string | The instance from which the snapshot was created. |
resource_type | string | The type of resource (usually InstanceSnapshot). |
state | string | The state the snapshot is in. |
from_instance_name | string | The instance from which the snapshot was created. |
from_instance_arn | string | The Amazon Resource Name (ARN) of the instance from which the snapshot was created. |
size_in_gb | integer | The size in GB of the SSD |
is_from_auto_snapshot | boolean | A Boolean value indicating whether the snapshot was created from an automatic snapshot. |
support_code | string | Support code to help identify any issues |
location | object | The region name and Availability Zone where you created the snapshot. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
instance_snapshot_name | string | The name of the snapshot. |
region | string | AWS region. |
For more information, see AWS::Lightsail::InstanceSnapshot.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | instance_snapshots | INSERT | InstanceSnapshotName, InstanceName, region |
delete_resource | instance_snapshots | DELETE | Identifier, region |
update_resource | instance_snapshots | UPDATE | Identifier, PatchDocument, region |
list_resources | instance_snapshots_list_only | SELECT | region |
get_resource | instance_snapshots | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = 'us-east-1' AND
Identifier = '{{ instance_snapshot_name }}';
Lists all instance_snapshots in a region.
SELECT
region,
instance_snapshot_name
FROM awscc.lightsail.instance_snapshots_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new instance_snapshot resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lightsail.instance_snapshots (
InstanceSnapshotName,
InstanceName,
region
)
SELECT
'{{ instance_snapshot_name }}',
'{{ instance_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.lightsail.instance_snapshots (
InstanceSnapshotName,
InstanceName,
Tags,
region
)
SELECT
'{{ instance_snapshot_name }}',
'{{ instance_name }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: instance_snapshot
props:
- name: instance_snapshot_name
value: '{{ instance_snapshot_name }}'
- name: instance_name
value: '{{ instance_name }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.lightsail.instance_snapshots
WHERE
Identifier = '{{ instance_snapshot_name }}' AND
region = 'us-east-1';
Permissions
To operate on the instance_snapshots resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
lightsail:CreateInstanceSnapshot,
lightsail:GetInstanceSnapshot,
lightsail:TagResource
lightsail:GetInstanceSnapshot
lightsail:GetInstanceSnapshot,
lightsail:TagResource,
lightsail:UntagResource
lightsail:GetInstanceSnapshot,
lightsail:DeleteInstanceSnapshot
lightsail:GetInstanceSnapshots