turbot/alicloud

steampipe plugin install alicloudsteampipe plugin install alicloud

Table: alicloud_ecs_image

An ECS image stores information that is required to create an ECS instance. An image works as a copy that stores data from one or more disks. An ECS instance image may store data from a system disk or from both system and data disks.

Examples

Image basic info

select
name,
image_id,
arn,
size,
status,
usage
from
alicloud_ecs_image;

List of public images

select
name,
image_id,
image_owner_alias
from
alicloud_ecs_image
where
image_owner_alias = 'system';

List of custom (user-defined) images defined in this account

select
name,
image_id,
image_owner_alias,
is_self_shared,
size,
status,
architecture,
os_name_en
from
alicloud_ecs_image
where
image_owner_alias = 'self';

List of user-defined images which do not have owner tag key

select
name,
image_id,
tags
from
alicloud_ecs_image
where
tags -> 'owner' is null
and image_owner_alias = 'self';

List of available images older than 90 days

select
name,
image_id,
creation_time,
age(creation_time),
status
from
alicloud_ecs_image
where
creation_time <= (current_date - interval '90' day)
and status = 'Available'
order by
creation_time;

List of unused images

select
name,
image_id
from
alicloud_ecs_image
where
usage = 'none';

List of instances created from an image older than 90 days old

select
instance.name as instance_name,
instance.instance_id as instance_id,
image.name as image_name,
instance.status as instance_status,
age(image.creation_time) as image_age,
age(instance.creation_time) as instance_age
from
alicloud_ecs_image as image,
alicloud_ecs_instance as instance
where
instance.image_id = image.image_id
and image.creation_time <= (current_date - interval '90' day)

.inspect alicloud_ecs_image

AliCloud ECS Image.

NameTypeDescription
account_idtextThe Alicloud Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
architecturetextThe image architecture. Possible values are: 'i386', and 'x86_64'.
arntextThe Alibaba Cloud Resource Name (ARN) of the ECS image.
creation_timetimestamp without time zoneThe time when the image was created.
descriptiontextA user-defined, human readable description for the image.
disk_device_mappingsjsonbThe mappings between disks and snapshots under the image.
image_familytextThe name of the image family.
image_idtextThe ID of the image that the instance is running.
image_owner_aliastextThe alias of the image owner. Possible values are: system, self, others, marketplace.
image_versiontextThe version of the image.
is_copiedbooleanIndicates whether the image is a copy of another image.
is_self_sharedbooleanIndicates whether the image has been shared to other Alibaba Cloud accounts.
is_subscribedbooleanIndicates whether you have subscribed to the image that corresponds to the specified product code.
is_support_cloud_initbooleanIndicates whether the image supports cloud-init.
is_support_io_optimizedbooleanIndicates whether the image can be used on I/O optimized instances.
nametextA friendly name of the resource.
os_nametextThe Chinese name of the operating system.
os_name_entextThe English name of the operating system.
os_typetextThe type of the operating system. Possible values are: windows,and linux
platformtextThe platform of the operating system.
product_codetextThe product code of the Alibaba Cloud Marketplace image.
progresstextThe image creation progress, in percent(%).
regiontextThe Alicloud region in which the resource is located.
resource_group_idtextThe ID of the resource group to which the image belongs.
share_permissionsjsonbA list of groups and accounts that the image can be shared.
sizebigintThe size of the image (in GiB).
statustextThe status of the image.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags attached with the image.
titletextTitle of the resource.
usagetextIndicates whether the image has been used to create ECS instances.