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, zonefrom 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, zonefrom alicloud_ecs_instancewhere stopped_mode = 'KeepCharging';
List linux instances
select instance_id, name, instance_type, os_name_en, zonefrom alicloud_ecs_instancewhere os_type = 'linux';
Instance count in each zone
select zone as az, count(*)from alicloud_ecs_instancegroup by zone;
Count the number of instances by instance type
select instance_type, count(instance_type) as countfrom alicloud_ecs_instancegroup by instance_type;
List of instances without application tag key
select instance_id, tagsfrom alicloud_ecs_instancewhere 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 countfrom alicloud_ecs_instancewhere 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_protectionfrom alicloud_ecs_instancewhere not deletion_protection;
Query examples
- ecs_autoscaling_groups_for_ecs_instance
- ecs_disks_for_ecs_instance
- ecs_images_for_ecs_instance
- ecs_instance_1_year_count
- ecs_instance_24_hours_count
- ecs_instance_30_90_days_count
- ecs_instance_30_days_count
- ecs_instance_90_365_days_count
- ecs_instance_by_account
- ecs_instance_by_creation_month
- ecs_instance_by_deletion_protection
- ecs_instance_by_io_optimized
- ecs_instance_by_network_type
- ecs_instance_by_os_type
- ecs_instance_by_public_ip
- ecs_instance_by_region
- ecs_instance_by_type
- ecs_instance_count
- ecs_instance_cpu_cores
- ecs_instance_dedicated_host
- ecs_instance_deletion_protection_disabled_count
- ecs_instance_input
- ecs_instance_io_optimized
- ecs_instance_io_optimized_count
- ecs_instance_network_interfaces
- ecs_instance_os_type
- ecs_instance_overview
- ecs_instance_public_access
- ecs_instance_public_access_count
- ecs_instance_public_access_table
- ecs_instance_public_instance_count
- ecs_instance_security_groups
- ecs_instance_tags
- ecs_instance_total_cores
- ecs_instance_total_cores_count
- ecs_instance_type
- ecs_instances_for_ecs_disk
- ecs_instances_for_ecs_security_group
- ecs_instances_for_ecs_snapshot
- ecs_instances_for_ram_role
- ecs_instances_for_vpc
- ecs_instances_for_vpc_vswitch
- ecs_network_interfaces_for_ecs_instance
- ecs_security_group_egress_rule_sankey
- ecs_security_group_ingress_rule_sankey
- ecs_security_groups_for_ecs_instance
- ecs_snapshots_for_ecs_instance
- ram_roles_for_ecs_instance
- vpc_eips_for_ecs_instance
- vpc_vpcs_for_ecs_instance
- vpc_vswitch_association
- vpc_vswitches_for_ecs_instance
Control examples
- ecs_disk_attached_stopped_instance
- ecs_instance_large
- ecs_instance_long_running
- ecs_instance_with_low_utilization
- vpc_nat_gateway_unused
- ecs_instance_with_no_legacy_network
- ecs_disk_attached_instances
- ecs_instance_age_table
- ecs_instance_by_state
- ecs_instance_status
- ecs_security_group_associated
.inspect alicloud_ecs_instance
Alicloud Elastic Compute Instance
Name | Type | Description |
---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. |
account_id | text | The Alicloud Account ID in which the resource is located. |
activation_id | text | The activation Id if the instance. |
agent_version | text | The agent version. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. |
arn | text | The Alibaba Cloud Resource Name (ARN) of the ECS instance. |
auto_release_time | timestamp with time zone | The automatic release time of the pay-as-you-go instance. |
billing_method | text | The billing method for network usage. |
connected | boolean | Indicates whether the instance is connected.. |
cpu | bigint | The number of vCPUs. |
cpu_options_core_count | bigint | The number of CPU cores. |
cpu_options_numa | text | The number of threads allocated. |
cpu_options_threads_per_core | bigint | The number of threads per core. |
creation_time | timestamp with time zone | The time when the instance was created. |
credit_specification | text | The performance mode of the burstable instance. |
dedicated_host_cluster_id | text | The cluster ID of the dedicated host. |
dedicated_host_id | text | The ID of the dedicated host. |
dedicated_host_name | text | The name of the dedicated host. |
dedicated_instance_affinity | text | Indicates whether the instance on a dedicated host is associated with the dedicated host. |
dedicated_instance_tenancy | text | Indicates whether the instance is hosted on a dedicated host. |
deletion_protection | boolean | Indicates whether you can use the ECS console or call the DeleteInstance operation to release the instance. |
deployment_set_group_no | bigint | The group No. of the instance in a deployment set when the deployment set is used to distribute instances across multiple physical machines. |
deployment_set_id | text | The ID of the deployment set. |
description | text | The description of the instance. |
device_available | boolean | Indicates whether data disks can be attached to the instance. |
ecs_capacity_reservation_id | text | The ID of the capacity reservation. |
ecs_capacity_reservation_preference | text | The preference of the ECS capacity reservation. |
eip_address | jsonb | The information of the EIP associated with the instance. |
expired_time | timestamp with time zone | The expiration time of the instance. |
family | text | The instance family of the instance. |
gpu_amount | bigint | The number of GPUs for the instance type. |
gpu_spec | text | The category of GPUs for the instance type. |
host_name | text | The hostname of the instance. |
hpc_cluster_id | text | The ID of the HPC cluster to which the instance belongs. |
image_id | text | The ID of the image that the instance is running. |
inner_ip_address | jsonb | The 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_id | text | The ID of the instance. |
instance_network_type | text | The network type of the instance. |
instance_type | text | The type of the instance. |
internet_charge_type | text | The billing method for network usage. Valid values:PayByBandwidth,PayByTraffic |
internet_max_bandwidth_in | bigint | The maximum inbound bandwidth from the Internet (in Mbit/s). |
internet_max_bandwidth_out | bigint | The maximum outbound bandwidth to the Internet (in Mbit/s). |
invocation_count | bigint | The count of instance invocation |
io_optimized | boolean | Specifies whether the instance is I/O optimized. |
is_spot | boolean | Indicates whether the instance is a spot instance, or not. |
key_pair_name | text | The name of the SSH key pair for the instance. |
last_invoked_time | timestamp with time zone | The time when the instance is last invoked. |
local_storage_amount | bigint | The number of local disks attached to the instance. |
local_storage_capacity | bigint | The capacity of local disks attached to the instance. |
memory | bigint | The memory size of the instance (in MiB). |
metadata_options | jsonb | The collection of metadata options. |
name | text | The name of the instance. |
network_interfaces | jsonb | Details about the ENIs bound to the instance. |
network_type | text | The type of the network. |
operation_locks | jsonb | Details about the reasons why the instance was locked. |
os_name | text | The name of the operating system for the instance. |
os_name_en | text | The English name of the operating system for the instance. |
os_type | text | The type of the operating system. Possible values are: windows and linux. |
os_version | text | The version of the operating system. |
private_ip_address | jsonb | The private IP addresses of instances. |
public_ip_address | jsonb | The public IP addresses of instances. |
ram_role | jsonb | RAM role attached to the instance. |
rdma_ip_address | jsonb | The RDMA IP address of HPC instance. |
recyclable | boolean | Indicates whether the instance can be recycled. |
region | text | The Alicloud region in which the resource is located. |
registration_time | timestamp with time zone | The time when the instance is registered. |
resource_group_id | text | The ID of the resource group to which the instance belongs. |
sale_cycle | text | The billing cycle of the instance. |
security_group_ids | jsonb | The IDs of security groups to which the instance belongs. |
serial_number | text | The serial number of the instance. |
spot_duration | bigint | The protection period of the preemptible instance (in hours). |
spot_price_limit | double precision | The maximum hourly price for the instance. |
spot_strategy | text | The preemption policy for the pay-as-you-go instance. |
start_time | timestamp with time zone | The start time of the bidding mode for the preemptible instance. |
status | text | The status of the instance. Possible values are: Pending, Running, Starting, Stopping, and Stopped |
stopped_mode | text | Indicates whether the instance continues to be billed after it is stopped. |
tags | jsonb | A map of tags for the resource. |
tags_src | jsonb | A list of tags attached with the resource. |
title | text | Title of the resource. |
vlan_id | text | The VLAN ID of the instance. |
vpc_attributes | jsonb | The VPC attributes of the instance. |
vpc_id | text | The type of the instance. |
zone | text | The zone in which the instance resides. |