CfnNetworkInterfaceProps

class aws_cdk.aws_ec2.CfnNetworkInterfaceProps(*, subnet_id, description=None, group_set=None, interface_type=None, ipv6_address_count=None, ipv6_addresses=None, private_ip_address=None, private_ip_addresses=None, secondary_private_ip_address_count=None, source_dest_check=None, tags=None)

Bases: object

Properties for defining a CfnNetworkInterface.

Parameters
  • subnet_id (str) – The ID of the subnet to associate with the network interface.

  • description (Optional[str]) – A description for the network interface.

  • group_set (Optional[Sequence[str]]) – The security group IDs associated with this network interface.

  • interface_type (Optional[str]) – The type of network interface. The default is interface . The supported values are efa and trunk .

  • ipv6_address_count (Union[int, float, None]) – The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. To specify specific IPv6 addresses, use the Ipv6Addresses property and don’t specify this property.

  • ipv6_addresses (Union[IResolvable, Sequence[Union[IResolvable, InstanceIpv6AddressProperty]], None]) – One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface. If you’re specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don’t specify this property.

  • private_ip_address (Optional[str]) – Assigns a single private IP address to the network interface, which is used as the primary private IP address. If you want to specify multiple private IP address, use the PrivateIpAddresses property.

  • private_ip_addresses (Union[IResolvable, Sequence[Union[IResolvable, PrivateIpAddressSpecificationProperty]], None]) – Assigns private IP addresses to the network interface. You can specify a primary private IP address by setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify this property.

  • secondary_private_ip_address_count (Union[int, float, None]) – The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet’s IPv4 CIDR range. You can’t specify this option and specify more than one private IP address using privateIpAddresses . The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide .

  • source_dest_check (Union[bool, IResolvable, None]) – Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives. If the value is true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

  • tags (Optional[Sequence[CfnTag]]) – An arbitrary set of tags (key-value pairs) for this network interface.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2 as ec2

cfn_network_interface_props = ec2.CfnNetworkInterfaceProps(
    subnet_id="subnetId",

    # the properties below are optional
    description="description",
    group_set=["groupSet"],
    interface_type="interfaceType",
    ipv6_address_count=123,
    ipv6_addresses=[ec2.CfnNetworkInterface.InstanceIpv6AddressProperty(
        ipv6_address="ipv6Address"
    )],
    private_ip_address="privateIpAddress",
    private_ip_addresses=[ec2.CfnNetworkInterface.PrivateIpAddressSpecificationProperty(
        primary=False,
        private_ip_address="privateIpAddress"
    )],
    secondary_private_ip_address_count=123,
    source_dest_check=False,
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

description

A description for the network interface.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-description

Return type

Optional[str]

group_set

The security group IDs associated with this network interface.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-groupset

Return type

Optional[List[str]]

interface_type

The type of network interface.

The default is interface . The supported values are efa and trunk .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-interfacetype

Return type

Optional[str]

ipv6_address_count

The number of IPv6 addresses to assign to a network interface.

Amazon EC2 automatically selects the IPv6 addresses from the subnet range. To specify specific IPv6 addresses, use the Ipv6Addresses property and don’t specify this property.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-ipv6addresscount

Return type

Union[int, float, None]

ipv6_addresses

One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.

If you’re specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don’t specify this property.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-ipv6addresses

Return type

Union[IResolvable, List[Union[IResolvable, InstanceIpv6AddressProperty]], None]

private_ip_address

Assigns a single private IP address to the network interface, which is used as the primary private IP address.

If you want to specify multiple private IP address, use the PrivateIpAddresses property.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-privateipaddress

Return type

Optional[str]

private_ip_addresses

Assigns private IP addresses to the network interface.

You can specify a primary private IP address by setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify this property.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-privateipaddresses

Return type

Union[IResolvable, List[Union[IResolvable, PrivateIpAddressSpecificationProperty]], None]

secondary_private_ip_address_count

The number of secondary private IPv4 addresses to assign to a network interface.

When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet’s IPv4 CIDR range. You can’t specify this option and specify more than one private IP address using privateIpAddresses .

The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-secondaryprivateipaddresscount

Return type

Union[int, float, None]

source_dest_check

Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives.

If the value is true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-sourcedestcheck

Return type

Union[bool, IResolvable, None]

subnet_id

The ID of the subnet to associate with the network interface.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-subnetid

Return type

str

tags

An arbitrary set of tags (key-value pairs) for this network interface.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#cfn-ec2-networkinterface-tags

Return type

Optional[List[CfnTag]]