Skip to content

NetworkInterface

This class encapsulates and extends the ROS resource type ALIYUN::ECS::NetworkInterface, which is used to create an elastic network interface (ENI).

Initializers

import ros_cdk_ecs
ros_cdk_ecs.NetworkInterface(
  scope: Construct,
  id: str,
  v_switch_id: typing.Union[str, IResolvable],
  delete_on_release: typing.Union[bool, IResolvable] = None,
  description: typing.Union[str, IResolvable] = None,
  ipv4_prefix_count: typing.Union[typing.Union[int, float], IResolvable] = None,
  ipv4_prefixes: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  ipv6_address_count: typing.Union[typing.Union[int, float], IResolvable] = None,
  ipv6_addresses: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  ipv6_prefix_count: typing.Union[typing.Union[int, float], IResolvable] = None,
  ipv6_prefixes: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  network_interface_name: typing.Union[str, IResolvable] = None,
  network_interface_traffic_mode: typing.Union[str, IResolvable] = None,
  primary_ip_address: typing.Union[str, IResolvable] = None,
  private_ip_addresses: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  queue_number: typing.Union[typing.Union[int, float], IResolvable] = None,
  resource_group_id: typing.Union[str, IResolvable] = None,
  rx_queue_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  secondary_private_ip_address_count: typing.Union[typing.Union[int, float], IResolvable] = None,
  security_group_id: typing.Union[str, IResolvable] = None,
  security_group_ids: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  tags: typing.List[TagsProperty] = None,
  tx_queue_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
v_switch_id typing.Union[str, ros_cdk_core.IResolvable] Property vSwitchId: VSwitch ID of the specified VPC.
delete_on_release typing.Union[bool, ros_cdk_core.IResolvable] Property deleteOnRelease: Specifies whether to delete the ENI when the instance is released.
description typing.Union[str, ros_cdk_core.IResolvable] Property description: Description of your ENI.
ipv4_prefix_count typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property ipv4PrefixCount: Specifies one or more IPv4 prefixes for the elastic network interface.
ipv4_prefixes typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property ipv4Prefixes: Specifies one or more IPv4 prefixes for the elastic network interface.
ipv6_address_count typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property ipv6AddressCount: The number of randomly generated IPv6 addresses that are assigned to the ENI.
ipv6_addresses typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property ipv6Addresses: The IPv6 address N to assign to the ENI.
ipv6_prefix_count typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property ipv6PrefixCount: Specifies one or more IPv6 prefixes for the elastic network interface.
ipv6_prefixes typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property ipv6Prefixes: Specifies one or more IPv6 prefixes for the elastic network interface.
network_interface_name typing.Union[str, ros_cdk_core.IResolvable] Property networkInterfaceName: Name of your ENI.
network_interface_traffic_mode typing.Union[str, ros_cdk_core.IResolvable] Property networkInterfaceTrafficMode: The communication mode of the ENI.
primary_ip_address typing.Union[str, ros_cdk_core.IResolvable] Property primaryIpAddress: The primary private IP address of the ENI.
private_ip_addresses typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property privateIpAddresses: Specifies secondary private IP addresses of the ENI.
queue_number typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property queueNumber: The number of queues that are supported by the ENI.
resource_group_id typing.Union[str, ros_cdk_core.IResolvable] Property resourceGroupId: Resource group id.
rx_queue_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property rxQueueSize: Elastic network card inbound queue depth.
secondary_private_ip_address_count typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property secondaryPrivateIpAddressCount: The number of private IP addresses that can be created automatically by ECS.
security_group_id typing.Union[str, ros_cdk_core.IResolvable] Property securityGroupId: The ID of the security group that the ENI joins.
security_group_ids typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property securityGroupIds: The IDs of the security groups that the ENI joins.
tags typing.List[TagsProperty] Property tags: Tags to attach to instance.
tx_queue_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property txQueueSize: Elastic network card outbound queue depth.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

v_switch_idRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property vSwitchId: VSwitch ID of the specified VPC.

Specifies the switch ID for the VPC.


delete_on_releaseOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property deleteOnRelease: Specifies whether to delete the ENI when the instance is released.


descriptionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property description: Description of your ENI.

It is a string of [2, 256] English or Chinese characters.


ipv4_prefix_countOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property ipv4PrefixCount: Specifies one or more IPv4 prefixes for the elastic network interface.

Range: 1-10 Note: If you need to set an IPv4 prefix for an elastic network interface, you must set either Ipv4Prefixes or Ipv4PrefixCount, but not both.


ipv4_prefixesOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]

Property ipv4Prefixes: Specifies one or more IPv4 prefixes for the elastic network interface.


ipv6_address_countOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property ipv6AddressCount: The number of randomly generated IPv6 addresses that are assigned to the ENI.


ipv6_addressesOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]

Property ipv6Addresses: The IPv6 address N to assign to the ENI.


ipv6_prefix_countOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property ipv6PrefixCount: Specifies one or more IPv6 prefixes for the elastic network interface.

Range: 1-10 Note: If you need to set an IPv6 prefix for an elastic network interface, you must set either Ipv6Prefixes or Ipv6PrefixCount, but not both.


ipv6_prefixesOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]

Property ipv6Prefixes: Specifies one or more IPv6 prefixes for the elastic network interface.


network_interface_nameOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property networkInterfaceName: Name of your ENI.

It is a string of [2, 128] Chinese or English characters. It must begin with a letter and can contain numbers, underscores (_), colons (:), or hyphens (-).


network_interface_traffic_modeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property networkInterfaceTrafficMode: The communication mode of the ENI.

Valid values: Standard: uses the TCP communication mode. HighPerformance: enables the Elastic RDMA Interface (ERI) and uses the remote direct memory access (RDMA) communication mode.


primary_ip_addressOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property primaryIpAddress: The primary private IP address of the ENI.

The specified IP address must have the same Host ID as the VSwitch. If no IP addresses are specified, a random network ID is assigned for the ENI.


private_ip_addressesOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]

Property privateIpAddresses: Specifies secondary private IP addresses of the ENI.

This IP address must be an available IP address in the CIDR block of the VSwitch to which the ENI belongs.


queue_numberOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property queueNumber: The number of queues that are supported by the ENI.

Valid values: 1 to 2048. When you attach the ENI to an instance, make sure that the value of this parameter is less than the maximum number of queues per ENI that is allowed for the instance type. To view the maximum number of queues per ENI allowed for an instance type, you can call DescribeInstanceTypes and then check the return value of MaximumQueueNumberPerEni. By default, this parameter is empty. If you do not specify this parameter, the default number of queues per ENI for the instance type of an instance is used when you attach the ENI to the instance. To learn about the default number of queues per ENI for an instance type, you can call DescribeInstanceTypes and then check the return value of SecondaryEniQueueNumber.


resource_group_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resourceGroupId: Resource group id.


rx_queue_sizeOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property rxQueueSize: Elastic network card inbound queue depth.

Note: The inbound queue depth of the network card must be equal to the outbound queue depth, ranging from 8192 to 16384, and must be a power of two. Larger inbound queue depth can improve inbound throughput, but it consumes more memory.


secondary_private_ip_address_countOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property secondaryPrivateIpAddressCount: The number of private IP addresses that can be created automatically by ECS.


security_group_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property securityGroupId: The ID of the security group that the ENI joins.

The security group and the ENI must be in a same VPC.


security_group_idsOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]

Property securityGroupIds: The IDs of the security groups that the ENI joins.

The security groups and the ENI must belong to the same VPC.


tagsOptional

Property tags: Tags to attach to instance.

Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.


tx_queue_sizeOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property txQueueSize: Elastic network card outbound queue depth.

Note: The outbound queue depth of the network card must be equal to the inbound queue depth, ranging from 8192 to 16384, and must be a power of two. Larger outbound queue depth can improve outbound throughput, but it consumes more memory.


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

import ros_cdk_ecs
ros_cdk_ecs.NetworkInterface.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_mac_address ros_cdk_core.IResolvable Attribute MacAddress: The MAC address of your Network Interface.
attr_network_interface_id ros_cdk_core.IResolvable Attribute NetworkInterfaceId: ID of your Network Interface.
attr_private_ip_address ros_cdk_core.IResolvable Attribute PrivateIpAddress: The primary private ip address of your Network Interface.
attr_secondary_private_ip_addresses ros_cdk_core.IResolvable Attribute SecondaryPrivateIpAddresses: The secondary private IP addresses of your Network Interface.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_mac_addressRequired

attr_mac_address: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute MacAddress: The MAC address of your Network Interface.


attr_network_interface_idRequired

attr_network_interface_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute NetworkInterfaceId: ID of your Network Interface.


attr_private_ip_addressRequired

attr_private_ip_address: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute PrivateIpAddress: The primary private ip address of your Network Interface.


attr_secondary_private_ip_addressesRequired

attr_secondary_private_ip_addresses: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute SecondaryPrivateIpAddresses: The secondary private IP addresses of your Network Interface.