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_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;

Query examples

Control examples

.inspect alicloud_ecs_instance

Alicloud Elastic Compute Instance

NameTypeDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
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 with 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 with 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 with 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 with 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.
ram_rolejsonbRAM role attached to the instance.
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 with 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 with 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.
vpc_idtextThe type of the instance.
zonetextThe zone in which the instance resides.