turbot/alicloud

GitHub
steampipe plugin install alicloudsteampipe plugin install alicloud
alicloud_accountalicloud_action_trailalicloud_cas_certificatealicloud_cms_monitor_hostalicloud_cs_kubernetes_clusteralicloud_cs_kubernetes_cluster_nodealicloud_ecs_auto_provisioning_groupalicloud_ecs_autoscaling_groupalicloud_ecs_diskalicloud_ecs_disk_metric_read_iopsalicloud_ecs_disk_metric_read_iops_dailyalicloud_ecs_disk_metric_read_iops_hourlyalicloud_ecs_disk_metric_write_iopsalicloud_ecs_disk_metric_write_iops_dailyalicloud_ecs_disk_metric_write_iops_hourlyalicloud_ecs_imagealicloud_ecs_instancealicloud_ecs_instance_metric_cpu_utilization_dailyalicloud_ecs_instance_metric_cpu_utilization_hourlyalicloud_ecs_key_pairalicloud_ecs_launch_templatealicloud_ecs_network_interfacealicloud_ecs_regionalicloud_ecs_security_groupalicloud_ecs_snapshotalicloud_ecs_zonealicloud_kms_keyalicloud_kms_secretalicloud_oss_bucketalicloud_ram_access_keyalicloud_ram_credential_reportalicloud_ram_groupalicloud_ram_password_policyalicloud_ram_policyalicloud_ram_rolealicloud_ram_security_preferencealicloud_ram_useralicloud_rds_backupalicloud_rds_databasealicloud_rds_instancealicloud_rds_instance_metric_connectionsalicloud_rds_instance_metric_connections_dailyalicloud_rds_instance_metric_cpu_utilizationalicloud_rds_instance_metric_cpu_utilization_dailyalicloud_rds_instance_metric_cpu_utilization_hourlyalicloud_security_center_field_statisticsalicloud_security_center_versionalicloud_slb_load_balanceralicloud_vpcalicloud_vpc_dhcp_options_setalicloud_vpc_eipalicloud_vpc_flow_logalicloud_vpc_nat_gatewayalicloud_vpc_network_aclalicloud_vpc_route_entryalicloud_vpc_route_tablealicloud_vpc_ssl_vpn_client_certalicloud_vpc_ssl_vpn_serveralicloud_vpc_vpn_connectionalicloud_vpc_vpn_customer_gatewayalicloud_vpc_vpn_gatewayalicloud_vpc_vswitch

Table: alicloud_ecs_disk

Cloud disks are block-level Elastic Block Storage (EBS) products provided by Alibaba Cloud for ECS and provide low latency, high performance, high durability, and high reliability. Cloud disks use a distributed triplicate mechanism to ensure data durability for ECS instances. If service disruptions occur within a zone (for example, due to hardware failures), data within the zone is copied to an available disk in another zone to help ensure data availability.

Examples

Basic info

select
name,
disk_id,
arn,
size,
type,
billing_method,
zone,
region
from
alicloud_ecs_disk;

Unencrypted Disks

select
name,
disk_id,
encrypted,
zone,
status,
size,
instance_id,
kms_key_id
from
alicloud_ecs_disk
where
not encrypted;

List of disks Encrypted with Default Service CMK

select
name,
disk_id,
encrypted,
zone,
status,
size,
instance_id,
kms_key_id
from
alicloud_ecs_disk
where
encrypted
and kms_key_id = '';

List Auto Snapshot Policy details applied to disk

select
name,
auto_snapshot_policy_id,
auto_snapshot_policy_name,
auto_snapshot_policy_creation_time,
auto_snapshot_policy_enable_cross_region_copy,
auto_snapshot_policy_repeat_week_days,
auto_snapshot_policy_retention_days,
auto_snapshot_policy_status,
auto_snapshot_policy_time_points,
auto_snapshot_policy_tags
from
alicloud_ecs_disk;

List of disks without owner tag key

select
name,
disk_id,
tags
from
alicloud_ecs_disk
where
tags ->> 'owner' is null;

List disks attached to a specific instance

select
name,
disk_id,
size,
type,
billing_method,
zone,
region,
encrypted
from
alicloud_ecs_disk
where
instance_id = 'i-0xickpvpsaih9w7s4zrq';

List of disks not attached to any instances

select
name,
disk_id,
status,
attached_time,
detached_time
from
alicloud_ecs_disk
where
status = 'Available';

Disk count in each availability zone

select
zone,
count(*)
from
alicloud_ecs_disk
group by
zone
order by
count desc;

Top 10 largest Disks

select
name,
disk_id,
size,
status,
instance_id
from
alicloud_ecs_disk
order by
size desc
limit
10;

List of disks having no attached running instances

select
i.instance_id as "Instance ID",
i.name as "Name",
i.arn as "Instance ARN",
i.status as "Instance State",
attachment ->> 'AttachedTime' as "Attachment Time"
from
alicloud_ecs_disk as v,
jsonb_array_elements(attachments) as attachment,
alicloud_ecs_instance as i
where
i.instance_id = attachment ->> 'InstanceId'
and i.status <> 'Running'
order by
i.instance_id;

Query examples

Control examples

.inspect alicloud_ecs_disk

Elastic Compute Disk

NameTypeDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
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 ECS disk.
attached_timetimestamp with time zoneThe time when the disk was attached.
attachmentsjsonbThe attachment information of the cloud disk.
auto_snapshot_policy_creation_timetextThe time when the auto snapshot policy was created.
auto_snapshot_policy_enable_cross_region_copybooleanThe ID of the automatic snapshot policy applied to the disk.
auto_snapshot_policy_idtextThe ID of the automatic snapshot policy applied to the disk.
auto_snapshot_policy_nametextThe name of the automatic snapshot policy applied to the disk.
auto_snapshot_policy_repeat_week_daystextThe days of a week on which automatic snapshots are created. Valid values: 1 to 7, which corresponds to the days of the week. 1 indicates Monday. One or more days can be specified.
auto_snapshot_policy_retention_daysbigintThe retention period of the automatic snapshot.
auto_snapshot_policy_statustextThe status of the automatic snapshot policy.
auto_snapshot_policy_tagsjsonbThe days of a week on which automatic snapshots are created. Valid values: 1 to 7, which corresponds to the days of the week. 1 indicates Monday. One or more days can be specified.
auto_snapshot_policy_time_pointstextThe points in time at which automatic snapshots are created. The least interval at which snapshots can be created is one hour. Valid values: 0 to 23, which corresponds to the hours of the day from 00:00 to 23:00. 1 indicates 01:00. You can specify multiple points in time.
billing_methodtextThe billing method of the disk. Possible values are: PrePaid and PostPaid.
categorytextThe category of the disk.
creation_timetimestamp with time zoneThe time when the disk was created.
delete_auto_snapshotbooleanIndicates whether the automatic snapshots of the disk are deleted when the disk is released.
delete_with_instancebooleanIndicates whether the disk is released when its associated instance is released.
descriptiontextA user provided, human readable description for this resource.
detached_timetimestamp with time zoneThe time when the disk was detached.
devicetextThe device name of the disk on its associated instance.
disk_idtextAn unique identifier for the resource.
enable_auto_snapshotbooleanIndicates whether the automatic snapshot policy feature was enabled for the disk.
enable_automated_snapshot_policybooleanIndicates whether an automatic snapshot policy was applied to the disk.
encryptedbooleanIndicates whether the disk was encrypted.
expired_timetimestamp with time zoneThe time when the subscription disk expires.
image_idtextThe ID of the image used to create the instance. This parameter is empty unless the disk was created from an image. The value of this parameter remains unchanged throughout the lifecycle of the disk.
instance_idtextThe ID of the instance to which the disk is attached. This parameter has a value only when the value of Status is In_use.
iopsbigintThe number of input/output operations per second (IOPS).
iops_readbigintThe number of I/O reads per second.
iops_writebigintThe number of I/O writes per second.
kms_key_idtextThe device name of the disk on its associated instance.
mount_instance_numbigintThe number of instances to which the Shared Block Storage device is attached.
mount_instancesjsonbThe attaching information of the disk.
nametextA friendly name for the resource.
operation_lockjsonbThe reasons why the disk was locked.
performance_leveltextThe performance level of the ESSD.
portablebooleanIndicates whether the disk is removable.
product_codetextThe product code in Alibaba Cloud Marketplace.
regiontextThe Alicloud region in which the resource is located.
resource_group_idtextThe ID of the resource group to which the disk belongs.
serial_numbertextThe serial number of the disk.
sizebigintSpecifies the size of the disk.
source_snapshot_idtextThe ID of the snapshot used to create the disk. This parameter is empty unless the disk was created from a snapshot. The value of this parameter remains unchanged throughout the lifecycle of the disk.
statustextSpecifies the current state of the resource.
storage_set_idtextThe ID of the storage set.
storage_set_partition_numberbigintThe maximum number of partitions in a storage set.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags attached with the resource.
titletextTitle of the resource.
typetextSpecifies the type of the disk. Possible values are: 'system' and 'data'.
zonetextThe zone name in which the resource is created.