DATASOURCE::ECS::NetworkInterfaces is used to query the details of elastic network interfaces (ENIs).

Syntax

{
  "Type": "DATASOURCE::ECS::NetworkInterfaces",
  "Properties": {
    "Status": String,
    "PrivateIpAddresses": List,
    "ServiceManaged": Boolean,
    "ResourceGroupId": String,
    "InstanceId": String,
    "SecurityGroupId": String,
    "VSwitchId": String,
    "NetworkInterfaceName": String,
    "NetworkInterfaceIds": List,
    "PrimaryIpAddress": String,
    "Ipv6Addresses": List,
    "Type": String,
    "VpcId": String,
    "Tags": List
  }
}

Properties

Property Type Required Editable Description Constraint
Status String No Yes The state of the ENI. Valid values:
  • Available: The ENI is not bound to an instance.
  • Attaching: The ENI is being bound to an instance.
  • InUse: The ENI is bound to an instance.
  • Detaching: The ENI is being unbound from an instance.
  • Deleting: The ENI is being deleted.
Note If you do not specify this property, ENIs in all states are queried.
PrivateIpAddresses List No Yes The secondary private IPv4 address of the ENI. You can specify up to 100 IP addresses. Separate multiple IP addresses with commas (,).
ServiceManaged Boolean No Yes Specifies whether the user of the ENI is an Alibaba Cloud service or a distributor. Valid values:
  • true
  • false
ResourceGroupId String No Yes The ID of the resource group. None.
InstanceId String No Yes The ID of the Elastic Compute Service (ECS) instance to which the ENI is bound. None.
SecurityGroupId String No Yes The ID of the security group to which the secondary ENI is attached. To query the details of secondary ENIs based on the ID of a security group, specify this property.
VSwitchId String No Yes The ID of the vSwitch to which the ENI belongs. None.
NetworkInterfaceName String No Yes The name of the ENI. None.
NetworkInterfaceIds List No Yes The IDs of the ENIs. You can specify up to 100 ENI IDs. Separate multiple IDs with commas (,).
PrimaryIpAddress String No Yes The primary private IPv4 address of the ENI. None.
Ipv6Addresses List No Yes The IPv6 addresses of the ENI. You can specify up to 100 IP addresses. Separate multiple IP addresses with commas (,).
Type String No Yes The type of the ENI. Valid values:
  • Primary
  • Secondary
Note If you do not specify this property, all types of ENIs are queried.
VpcId String No Yes The ID of the VPC for the ENI. None.
Tags List No Yes The tags of the ENI. You can specify up to 20 tags.

For more information, see Tags properties.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property Type Required Editable Description Constraint
Value String No No The tag value of the ENI. None.
Key String Yes No The tag key of the ENI. None.

Return values (Fn::GetAtt)

  • NetworkInterfaceIds: the IDs of the ENIs.
  • NetworkInterfaces: details of the ENIs.
Property Type Description Constraint
NetworkInterfaceIds List The IDs of the ENIs. None.
NetworkInterfaces List Details of the ENIs. None.
VpcId String The ID of the VPC for the ENI. None.
Type String The type of the ENI. Valid values:
  • Primary
  • Secondary
Status String The state of the ENI. Valid values:
  • Available: The ENI is not bound to an instance.
  • Attaching: The ENI is being bound to an instance.
  • InUse: The ENI is bound to an instance.
  • Detaching: The ENI is being unbound from an instance.
  • Deleting: The ENI is being deleted.
NetworkInterfaceTrafficMode String The communication mode of the ENI. Valid values:
  • Standard: TCP communication mode
  • HighPerformance: RDMA communication mode
NetworkInterfaceId String The ID of the ENI. None.
InstanceId String The ID of the ECS instance to which the ENI is bound. None.
OwnerId String The ID of the Alibaba Cloud account to which the ENI belongs. None.
VSwitchId String The ID of the vSwitch to which the ENI belongs. None.
ResourceGroupId String The ID of the resource group. None.
ZoneId String The ID of the zone. None.
PrivateIpAddress String The secondary private IPv4 addresses of the ENI. None.
QueueNumber Number The number of queues supported by the ENI. Valid values:
  • If the ENI is a secondary ENI in the InUse state and the number of queues supported by this ENI has never been modified, the default number of queues per secondary ENI that the instance type supports is returned.
  • If the number of queues supported by the secondary ENI has been modified, the new number of queues is returned.
  • If the ENI is a secondary ENI in the Available state and the number of queues supported by this ENI has never been modified, an empty value is returned.
  • If the ENI is a primary ENI, the default number of queues per primary ENI that the instance type supports is returned.
PrivateIpSets List The private IP addresses of the instance. None.
Ipv6Sets List The IPv6 addresses assigned to the ENI. None.
Tags List The tags. None.
SecurityGroupIds List The IDs of the security groups to which the ENI is attached. None.
AssociatedPublicIp List The EIP associated with the secondary private IP address of the ENI. None.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Tags": {
      "Type": "Json",
      "Default": {"Key": "acs:privatelink:serviceType", "Value": "natgw"}
    }
  },
  "Resources": {
    "NetworkInterfaces": {
      "Type": "DATASOURCE::ECS::NetworkInterfaces",
      "Properties": {
        "RegionId": {
          "Ref": "ALIYUN::Region"
        },
        "Tags": {
          "Ref": "Tags"
        }
      }
    }
  },
  "Outputs": {
    "Images": {
      "Value": {
        "Fn::GetAtt": [
          "NetworkInterfaces",
          "NetworkInterfaceIds"
        ]
      }
    },
    "ImageIds": {
      "Value": {
        "Fn::GetAtt": [
          "NetworkInterfaces",
          "NetworkInterfaces"
        ]
      }
    }
  }
}