turbot/alicloud

steampipe plugin install alicloudsteampipe plugin install alicloud

Table: alicloud_ecs_instance

An ECS instance is a virtual machine that contains basic computing components such as the vCPU, memory, operating system, network, and disk.

Examples

Basic Instance Info

select
instance_id,
name,
arn,
status,
instance_type,
os_name_en,
public_ip_address,
private_ip_address,
zone
from
alicloud_ecs_instance;

List stopped instances that you are still being charged for

select
instance_id,
name,
status,
stopped_mode,
instance_type,
os_name_en,
public_ip_address,
private_ip_address,
zone
from
alicloud_ecs_instance
where
stopped_mode = 'KeepCharging';

List linux instances

select
instance_id,
name,
instance_type,
os_name_en,
zone
from
alicloud_ecs_instance
where
os_type = 'linux';

Instance count in each zone

select
zone as az,
count(*)
from
alicloud_ecs_instance
group by
zone;

Count the number of instances by instance type

select
instance_type,
count(instance_type) as count
from
alicloud_ecs_instance
group by
instance_type;

List of instances without application tag key

select
instance_id,
tags
from
alicloud_ecs_instance
where
tags ->> 'application' is null;

List of ECS instances provisioned with undesired(for example ecs.t5-lc2m1.nano and ecs.t6-c2m1.large is desired) instance type(s)

select
instance_type,
count(*) as count
from
alicloud_ecs_instance
where
instance_type not in ('ecs.t5-lc2m1.nano', 'ecs.t6-c2m1.large')
group by
instance_type;

List ECS instances having deletion protection safety feature disabled

select
instance_id,
deletion_protection
from
alicloud_ecs_instance
where
not deletion_protection;

.inspect alicloud_ecs_instance

Alicloud Elastic Compute Instance

NameTypeDescription
account_idtextThe Alicloud Account ID in which the resource is located.
activation_idtextThe activation Id if the instance.
agent_versiontextThe agent version.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Alibaba Cloud Resource Name (ARN) of the ECS instance.
auto_release_timetimestamp without time zoneThe automatic release time of the pay-as-you-go instance.
billing_methodtextThe billing method for network usage.
connectedbooleanIndicates whether the instance is connected..
cpubigintThe number of vCPUs.
cpu_options_core_countbigintThe number of CPU cores.
cpu_options_numatextThe number of threads allocated.
cpu_options_threads_per_corebigintThe number of threads per core.
creation_timetimestamp without time zoneThe time when the instance was created.
credit_specificationtextThe performance mode of the burstable instance.
dedicated_host_cluster_idtextThe cluster ID of the dedicated host.
dedicated_host_idtextThe ID of the dedicated host.
dedicated_host_nametextThe name of the dedicated host.
dedicated_instance_affinitytextIndicates whether the instance on a dedicated host is associated with the dedicated host.
dedicated_instance_tenancytextIndicates whether the instance is hosted on a dedicated host.
deletion_protectionbooleanIndicates whether you can use the ECS console or call the DeleteInstance operation to release the instance.
deployment_set_group_nobigintThe group No. of the instance in a deployment set when the deployment set is used to distribute instances across multiple physical machines.
deployment_set_idtextThe ID of the deployment set.
descriptiontextThe description of the instance.
device_availablebooleanIndicates whether data disks can be attached to the instance.
ecs_capacity_reservation_idtextThe ID of the capacity reservation.
ecs_capacity_reservation_preferencetextThe preference of the ECS capacity reservation.
eip_addressjsonbThe information of the EIP associated with the instance.
expired_timetimestamp without time zoneThe expiration time of the instance.
familytextThe instance family of the instance.
gpu_amountbigintThe number of GPUs for the instance type.
gpu_spectextThe category of GPUs for the instance type.
host_nametextThe hostname of the instance.
hpc_cluster_idtextThe ID of the HPC cluster to which the instance belongs.
image_idtextThe ID of the image that the instance is running.
inner_ip_addressjsonbThe internal IP addresses of classic network-type instances. This parameter takes effect when InstanceNetworkType is set to classic. The value can be a JSON array that consists of up to 100 IP addresses. Separate multiple IP addresses with commas (,).
instance_idtextThe ID of the instance.
instance_network_typetextThe network type of the instance.
instance_typetextThe type of the instance.
internet_charge_typetextThe billing method for network usage. Valid values:PayByBandwidth,PayByTraffic
internet_max_bandwidth_inbigintThe maximum inbound bandwidth from the Internet (in Mbit/s).
internet_max_bandwidth_outbigintThe maximum outbound bandwidth to the Internet (in Mbit/s).
invocation_countbigintThe count of instance invocation
io_optimizedbooleanSpecifies whether the instance is I/O optimized.
is_spotbooleanIndicates whether the instance is a spot instance, or not.
key_pair_nametextThe name of the SSH key pair for the instance.
last_invoked_timetimestamp without time zoneThe time when the instance is last invoked.
local_storage_amountbigintThe number of local disks attached to the instance.
local_storage_capacitybigintThe capacity of local disks attached to the instance.
memorybigintThe memory size of the instance (in MiB).
metadata_optionsjsonbThe collection of metadata options.
nametextThe name of the instance.
network_interfacesjsonbDetails about the ENIs bound to the instance.
network_typetextThe type of the network.
operation_locksjsonbDetails about the reasons why the instance was locked.
os_nametextThe name of the operating system for the instance.
os_name_entextThe English name of the operating system for the instance.
os_typetextThe type of the operating system. Possible values are: windows and linux.
os_versiontextThe version of the operating system.
private_ip_addressjsonbThe private IP addresses of instances.
public_ip_addressjsonbThe public IP addresses of instances.
rdma_ip_addressjsonbThe RDMA IP address of HPC instance.
recyclablebooleanIndicates whether the instance can be recycled.
regiontextThe Alicloud region in which the resource is located.
registration_timetimestamp without time zoneThe time when the instance is registered.
resource_group_idtextThe ID of the resource group to which the instance belongs.
sale_cycletextThe billing cycle of the instance.
security_group_idsjsonbThe IDs of security groups to which the instance belongs.
serial_numbertextThe serial number of the instance.
spot_durationbigintThe protection period of the preemptible instance (in hours).
spot_price_limitdouble precisionThe maximum hourly price for the instance.
spot_strategytextThe preemption policy for the pay-as-you-go instance.
start_timetimestamp without time zoneThe start time of the bidding mode for the preemptible instance.
statustextThe status of the instance. Possible values are: Pending, Running, Starting, Stopping, and Stopped
stopped_modetextIndicates whether the instance continues to be billed after it is stopped.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags attached with the resource.
titletextTitle of the resource.
vlan_idtextThe VLAN ID of the instance.
vpc_attributesjsonbThe VPC attributes of the instance.
zonetextThe zone in which the instance resides.