Table: alicloud_ecs_network_interface - Query Alibaba Cloud Elastic Compute Service Network Interfaces using SQL
A Network Interface in Alibaba Cloud Elastic Compute Service (ECS) is a virtual network interface card (vNIC) that is attached to an instance. It provides the primary network connection for communication with network services and other instances. Each network interface is associated with a security group that controls the traffic to the instance.
Table Usage Guide
The alicloud_ecs_network_interface
table provides insights into Network Interfaces within Alibaba Cloud Elastic Compute Service (ECS). As a network administrator or cloud engineer, explore network interface-specific details through this table, including its status, type, and associated security groups. Utilize it to uncover information about network interfaces, such as those with specific security groups, the status of each interface, and the type of network interface.
Examples
Basic ENI info
Explore the status and details of network interfaces within your Alicloud Elastic Compute Service. This can be useful to manage network configurations and troubleshoot connectivity issues.
select network_interface_id, type, description, status, instance_id, private_ip_address, associated_public_ip_address, mac_addressfrom alicloud_ecs_network_interface;
select network_interface_id, type, description, status, instance_id, private_ip_address, associated_public_ip_address, mac_addressfrom alicloud_ecs_network_interface;
Find all ENIs with private IPs that are in a given subnet (10.66.0.0/16)
Explore which Elastic Network Interfaces (ENIs) with private IPs fall within a specific subnet. This is particularly useful in understanding network configurations and managing resources within a particular network range.
select network_interface_id, type, description, private_ip_address, associated_public_ip_address, mac_addressfrom alicloud_ecs_network_interfacewhere private_ip_address << = '10.66.0.0/16';
Error: SQLite does not support CIDR operations.
Count of ENIs by interface type
Analyze the variety of network interfaces in use to understand their distribution within your Alicloud Elastic Compute Service (ECS). This is useful for gauging network capacity and planning for potential upgrades or changes.
select type, count(type) as countfrom alicloud_ecs_network_interfacegroup by typeorder by count desc;
select type, count(type) as countfrom alicloud_ecs_network_interfacegroup by typeorder by count desc;
Security groups attached to each ENI
Determine the areas in which security groups are associated with each Elastic Network Interface (ENI). This allows you to understand your network's security layout and identify potential vulnerabilities or areas for improvement.
select network_interface_id as eni, sgfrom alicloud_ecs_network_interface cross join jsonb_array_elements(security_group_ids) as sgorder by eni;
select network_interface_id as eni, sg.value as sgfrom alicloud_ecs_network_interface, json_each(security_group_ids) as sgorder by eni;
Find ENIs for a specific instance
Gain insights into the network interfaces associated with a specific instance, including their status, type, and IP addresses. This can be useful for troubleshooting connectivity issues or understanding the network configuration of a particular instance.
select network_interface_id as eni, instance_id, status, type, description, private_ip_address, associated_public_ip_address, mac_addressfrom alicloud_ecs_network_interfacewhere instance_id = 'i-0xi8u2s0ezl5auigem8t'
select network_interface_id as eni, instance_id, status, type, description, private_ip_address, associated_public_ip_address, mac_addressfrom alicloud_ecs_network_interfacewhere instance_id = 'i-0xi8u2s0ezl5auigem8t'
Query examples
Schema for alicloud_ecs_network_interface
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The alicloud Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
associated_public_ip_address | inet | The public IP address of the instance. | |
associated_public_ip_allocation_id | text | The allocation ID of the EIP. | |
attachment | jsonb | Attachments of the ENI | |
creation_time | timestamp with time zone | The time when the ENI was created. | |
description | text | The description of the ENI. | |
instance_id | text | The ID of the instance to which the ENI is bound. | |
ipv6_sets | jsonb | The IPv6 addresses assigned to the ENI. | |
mac_address | text | The MAC address of the ENI. | |
name | text | The name of the ENI. | |
network_interface_id | text | = | An unique identifier for the ENI. |
owner_id | text | The ID of the account that owns the ENI. | |
private_ip_address | inet | The private IP address of the ENI. | |
private_ip_sets | jsonb | The private IP addresses of the ENI. | |
queue_number | bigint | The number of queues supported by the ENI. | |
region | text | The Alicloud region in which the resource is located. | |
resource_group_id | text | The ID of the resource group to which the ENI belongs. | |
security_group_ids | jsonb | The IDs of the security groups to which the ENI belongs. | |
service_id | text | The ID of the distributor to which the ENI belongs. | |
service_managed | boolean | Indicates whether the user is an Alibaba Cloud service or a distributor. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | The status of the ENI. | |
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. | |
type | text | The type of the ENI. Valid values: 'Primary' and 'Secondary' | |
vpc_id | text | The ID of the VPC to which the ENI belongs. | |
vswitch_id | text | The ID of the VSwitch to which the ENI is connected. | |
zone_id | text | The zone ID of the ENI. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- alicloud
You can pass the configuration to the command with the --config
argument:
steampipe_export_alicloud --config '<your_config>' alicloud_ecs_network_interface