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 isinterface
. The supported values areefa
andtrunk
.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 theIpv6Addresses
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 theIpv6AddressCount
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 thePrivateIpAddresses
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 thePrimary
property totrue
in thePrivateIpAddressSpecification
property. If you want EC2 to automatically assign private IP addresses, use theSecondaryPrivateIpAddressCount
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 usingprivateIpAddresses
. 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 istrue
, source/destination checks are enabled; otherwise, they are disabled. The default value istrue
. 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.
-
group_set
¶ The security group IDs associated with this network interface.
- Link
- Return type
Optional
[List
[str
]]
-
interface_type
¶ The type of network interface.
The default is
interface
. The supported values areefa
andtrunk
.
-
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
- 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
- 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.
-
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 totrue
in thePrivateIpAddressSpecification
property. If you want EC2 to automatically assign private IP addresses, use theSecondaryPrivateIpAddressCount
property and do not specify this property.
-
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
- 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 istrue
. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.
-
subnet_id
¶ The ID of the subnet to associate with the network interface.
An arbitrary set of tags (key-value pairs) for this network interface.
- Link
- Return type
Optional
[List
[CfnTag
]]