All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::ECS::NetworkInterfaces

Last Updated:Nov 26, 2024

DATASOURCE::ECS::NetworkInterfaces is used to query the information about 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,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Status

String

No

Yes

The status of the ENI.

Valid values:

  • Available: The ENI is available.

  • Attaching: The ENI is being attached to an instance.

  • InUse: The ENI is attached to an instance.

  • Detaching: The ENI is being detached from an instance.

  • Deleting: The ENI is being deleted.

Note

If you leave this property empty, ENIs in all states are queried.

PrivateIpAddresses

List

No

Yes

The secondary private IPv4 addresses 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 attached.

None.

SecurityGroupId

String

No

Yes

The ID of the security group to which the secondary ENI belongs.

If you want to query the information about 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 is connected.

None.

NetworkInterfaceName

String

No

Yes

The ENI name.

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 ENI type.

Valid values:

  • Primary

  • Secondary

Note

If you leave this property empty, all types of ENIs are queried.

VpcId

String

No

Yes

The ID of the virtual private cloud (VPC) to which the ENI belongs.

None.

Tags

List

No

Yes

The tags of the ENI.

You can add up to 20 tags.

For more information, see Tags properties.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

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 to which the ENI belongs.

None.

Type

String

The ENI type.

Valid values:

  • Primary

  • Secondary

Status

String

The status of the ENI.

Valid values:

  • Available: The ENI is available.

  • Attaching: The ENI is being attached to an instance.

  • InUse: The ENI is attached to an instance.

  • Detaching: The ENI is being detached from an instance.

  • Deleting: The ENI is being deleted.

NetworkInterfaceTrafficMode

String

The communication mode of the ENI.

Valid values:

  • Standard: TCP communication mode

  • HighPerformance: Remote Direct Memory Access (RDMA) communication mode

NetworkInterfaceId

String

The ENI ID.

None.

InstanceId

String

The ID of the ECS instance to which the ENI is attached.

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 is connected.

None.

ResourceGroupId

String

The ID of the resource group.

None.

ZoneId

String

The zone ID.

None.

PrivateIpAddress

String

The secondary private IPv4 address 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 the ENI has never been changed, the default number of queues per secondary ENI that the instance type supports is returned.

  • If the ENI is a secondary ENI and the number of queues supported by the ENI has been changed, 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 the ENI has never been changed, 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 belongs.

None.

AssociatedPublicIp

List

The elastic IP addresses (EIPs) 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"
        ]
      }
    }
  }
}