turbot/alicloud

steampipe plugin install alicloudsteampipe plugin install alicloud

Table: alicloud_ecs_snapshot

The Alibaba Cloud snapshot service allows you to create crash-consistent snapshots for all disk categories. Crash-consistent snapshots are an effective solution to disaster recovery and are used to back up data, create custom images, and implement disaster recovery for applications.

Examples

List of snapshots which are not encrypted

select
name,
snapshot_id,
arn,
encrypted
from
alicloud_ecs_snapshot
where
not encrypted;

List of unused snapshots

select
name,
snapshot_id,
type
from
alicloud_ecs_snapshot
where
usage = 'none';

Find the snapshot count per disk

select
source_disk_id,
count(*) as snapshot
from
alicloud_ecs_snapshot
group by
source_disk_id;

List of snapshots without owner tag key

select
name,
snapshot_id,
tags
from
alicloud_ecs_snapshot
where
tags ->> 'owner' is null;

List of snapshots older than 90 days

select
name,
snapshot_id,
type,
creation_time,
age(creation_time),
retention_days
from
alicloud_ecs_snapshot
where
creation_time <= (current_date - interval '90' day)
order by
creation_time;

Control examples

.inspect alicloud_ecs_snapshot

ECS Disk Snapshot.

NameTypeDescription
account_idtextThe alicloud Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Alibaba Cloud Resource Name (ARN) of the snapshot.
creation_timetimestamp without time zoneThe time when the snapshot was created.
descriptiontextA user provided, human readable description for this resource.
encryptedbooleanIndicates whether the snapshot was encrypted.
instant_accessbooleanIndicates whether the instant access feature is enabled.
instant_access_retention_daysbigintIndicates the retention period of the instant access feature. After the retention per iod ends, the snapshot is automatically released.
kms_key_idtextThe ID of the KMS key used by the data disk.
last_modified_timetimestamp without time zoneThe time when the snapshot was last changed.
nametextA friendly name for the resource.
product_codetextThe product code of the Alibaba Cloud Marketplace image.
progresstextThe progress of the snapshot creation task. Unit: percent (%).
regiontextThe region ID where the resource is located.
remain_timebigintThe remaining time required to create the snapshot (in seconds).
resource_group_idtextThe ID of the resource group to which the snapshot belongs.
retention_daysbigintThe number of days that an automatic snapshot can be retained.
serial_numbertextThe serial number of the snapshot.
snapshot_idtextAn unique identifier for the resource.
source_disk_idtextThe ID of the source disk. This parameter is retained even after the source disk of the snapshot is released.
source_disk_sizetextThe capacity of the source disk (in GiB).
source_disk_typetextThe category of the source disk.
statustextSpecifies the current state of the resource.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags attached with the resource.
titletextTitle of the resource.
typetextThe type of the snapshot. Default value: all. Possible values are: auto, user, and all.
usagetextIndicates whether the snapshot has been used to create images or disks.