文档

ALIYUN::ECS::NetworkInterface

更新时间:

ALIYUN::ECS::NetworkInterface类型用于创建一个弹性网卡(ENI)。

语法

{
  "Type": "ALIYUN::ECS::NetworkInterface",
  "Properties": {
    "Description": String,
    "SecurityGroupId": String,
    "PrimaryIpAddress": String,
    "ResourceGroupId": String,
    "VSwitchId": String,
    "NetworkInterfaceName": String,
    "Tags": List,
    "SecurityGroupIds": List,
    "PrivateIpAddresses": List,
    "SecondaryPrivateIpAddressCount": Integer,
    "Ipv6Addresses": List,
    "QueueNumber": Integer,
    "NetworkInterfaceTrafficMode": String,
    "Ipv6AddressCount": Integer
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ResourceGroupId

String

资源组ID。

您可以调用ListResourceGroups查询资源组ID。

SecurityGroupId

String

安全组ID。

安全组和弹性网卡必须在同一个专有网络中。

说明

不支持同时指定SecurityGroupId和SecurityGroupIds。

VSwitchId

String

交换机ID。

Description

String

弹性网卡的描述信息。

长度为2~256个字符,不能以http://https://开头。

NetworkInterfaceName

String

弹性网卡的名称。

长度为2~128个字符。必须以英文字母或汉字开头,不能以http://https://开头。可包含英文字母、汉字、数字、半角冒号(:)、下划线(_)和短划线(-)。

PrimaryIpAddress

String

弹性网卡的主私有IP地址。

指定IP地址必须是所属交换机地址段内的空闲地址,不指定则默认随机分配该交换机中的空闲地址。

SecondaryPrivateIpAddressCount

Integer

辅助私有IP地址数量。

Tags

List

标签。

最多支持添加20个标签。

更多信息,请参见Tags属性

SecurityGroupIds

List

一个或多个安全组ID。

安全组和弹性网卡必须在同一个专有网络中。

说明

不支持同时指定SecurityGroupId和SecurityGroupIds。

PrivateIpAddresses

List

从弹性网卡所属交换机的空闲IP地址中选择一个或多个辅助私有IP地址。

可以绑定的IP地址数量的取值范围:

  • 弹性网卡处于可用(Available)状态:1~10。

  • 弹性网卡处于已绑定(InUse)状态:受到实例规格限制。更多信息,请参见实例规格族

Ipv6Addresses

List

为弹性网卡指定一个或多个IPv6地址。

支持设置最多10个IPv6地址。

说明

如果您需要为弹性网卡设置IPv6地址,则必须设置Ipv6Addresses或者Ipv6AddressCount的其中一个,但不能同时设置这两个参数。

QueueNumber

Integer

弹性网卡队列数。

取值范围:1~2048

附加弹性网卡时,该值必须少于实例规格支持单块网卡的最大队列数。实例规格的单块网卡最大队列数可以通过DescribeInstanceTypes接口查询Max imumQueueNumberPerEni字段。

默认值:空。在附加时会采用实例规格的弹性网卡默认队列数,实例规格的弹性网卡默认队列数可以通过DescribeInstanceTypes接口查询SecondaryEniQueueNumber字段。

NetworkInterfaceTrafficMode

String

弹性网卡的通讯模式。

取值:

  • Standard:使用TCP通讯模式。

  • HighPerformance:开启ERI(Elastic RDMA Interface)接口,使用RDMA通讯模式。

    说明

    HighPerformance参数值只支持RDMA增强型实例规格族c7re,且RDMA模式的弹性网卡数量不能超过该实例规格族的限制。c7re正在华北2(北京)可用区K进行邀测。更多信息,请参见实例规格族

Ipv6AddressCount

Integer

为弹性网卡指定随机生成的IPv6地址数量。

取值范围:1~10。

说明

如果您需要为弹性网卡设置IPv6地址,则必须设置Ipv6Addresses或者Ipv6AddressCount的其中一个,但不能同时设置这两个参数。

Tags语法

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

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

长度为1~128个字符,不能以aliyunacs:开头,不能包含http://https://

Value

String

标签值。

长度为0~128个字符,不能以aliyunacs:开头,不能包含http://https://

返回值

Fn::GetAtt

  • NetworkInterfaceId:弹性网卡ID。

  • MacAddress:弹性网卡的MAC地址。

  • PrivateIpAddress:弹性网卡的私有IP地址。

  • SecondaryPrivateIpAddresses:弹性网卡的辅助私有IP地址。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      SecurityGroupId:
        Type: String
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        Label:
          zh-cn: 安全组ID
          en: Security Group ID
      VSwitchId:
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
        Type: String
        Label:
          zh-cn: 网络交换机ID
          en: VSwitch ID
    Resources:
      EniInstance:
        Type: ALIYUN::ECS::NetworkInterface
        Properties:
          SecurityGroupId:
            Ref: SecurityGroupId
          VSwitchId:
            Ref: VSwitchId
          NetworkInterfaceName: TestNetworkInterface
    Outputs:
      PrivateIpAddress:
        Description: The primary private ip address of your Network Interface.
        Value:
          Fn::GetAtt:
            - EniInstance
            - PrivateIpAddress
      SecondaryPrivateIpAddresses:
        Description: The secondary private IP addresses of your Network Interface.
        Value:
          Fn::GetAtt:
            - EniInstance
            - SecondaryPrivateIpAddresses
      MacAddress:
        Description: The MAC address of your Network Interface.
        Value:
          Fn::GetAtt:
            - EniInstance
            - MacAddress
      NetworkInterfaceId:
        Description: ID of your Network Interface.
        Value:
          Fn::GetAtt:
            - EniInstance
            - NetworkInterfaceId
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "SecurityGroupId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "Label": {
            "zh-cn": "安全组ID",
            "en": "Security Group ID"
          }
        },
        "VSwitchId": {
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
          "Type": "String",
          "Label": {
            "zh-cn": "网络交换机ID",
            "en": "VSwitch ID"
          }
        }
      },
      "Resources": {
        "EniInstance": {
          "Type": "ALIYUN::ECS::NetworkInterface",
          "Properties": {
            "SecurityGroupId": {
              "Ref": "SecurityGroupId"
            },
            "VSwitchId": {
              "Ref": "VSwitchId"
            },
            "NetworkInterfaceName": "TestNetworkInterface"
          }
        }
      },
      "Outputs": {
        "PrivateIpAddress": {
          "Description": "The primary private ip address of your Network Interface.",
          "Value": {
            "Fn::GetAtt": [
              "EniInstance",
              "PrivateIpAddress"
            ]
          }
        },
        "SecondaryPrivateIpAddresses": {
          "Description": "The secondary private IP addresses of your Network Interface.",
          "Value": {
            "Fn::GetAtt": [
              "EniInstance",
              "SecondaryPrivateIpAddresses"
            ]
          }
        },
        "MacAddress": {
          "Description": "The MAC address of your Network Interface.",
          "Value": {
            "Fn::GetAtt": [
              "EniInstance",
              "MacAddress"
            ]
          }
        },
        "NetworkInterfaceId": {
          "Description": "ID of your Network Interface.",
          "Value": {
            "Fn::GetAtt": [
              "EniInstance",
              "NetworkInterfaceId"
            ]
          }
        }
      }
    }

更多示例,请参见创建一个弹性网卡、绑定弹性网卡到专有网络类型实例和授权弹性网卡的组合示例:JSON示例YAML示例

  • 本页导读 (1)
文档反馈