CfnNetworkInterfaceProps Struct
Properties for defining a CfnNetworkInterface.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnNetworkInterfaceProps: ec2.CfnNetworkInterfaceProps = {
subnetId: 'subnetId',
// the properties below are optional
connectionTrackingSpecification: {
tcpEstablishedTimeout: 123,
udpStreamTimeout: 123,
udpTimeout: 123,
},
description: 'description',
enablePrimaryIpv6: false,
groupSet: ['groupSet'],
interfaceType: 'interfaceType',
ipv4PrefixCount: 123,
ipv4Prefixes: [{
ipv4Prefix: 'ipv4Prefix',
}],
ipv6AddressCount: 123,
ipv6Addresses: [{
ipv6Address: 'ipv6Address',
}],
ipv6PrefixCount: 123,
ipv6Prefixes: [{
ipv6Prefix: 'ipv6Prefix',
}],
privateIpAddress: 'privateIpAddress',
privateIpAddresses: [{
primary: false,
privateIpAddress: 'privateIpAddress',
}],
publicIpDnsHostnameTypeSpecification: 'publicIpDnsHostnameTypeSpecification',
secondaryPrivateIpAddressCount: 123,
sourceDestCheck: false,
tags: [{
key: 'key',
value: 'value',
}],
};
Properties
connectionTrackingSpecificationIResolvable | CfnNetworkInterface.ConnectionTrackingSpecificationPropertyconnection_tracking_specificationtyping.Union[IResolvable, ConnectionTrackingSpecificationProperty]connectionTrackingSpecificationIResolvableConnectionTrackingSpecificationIResolvableConnectionTrackingSpecificationinterface{}#enablePrimaryIpv6boolean | IResolvableenable_primary_ipv6typing.Union[bool, IResolvable]enablePrimaryIpv6BooleanEnablePrimaryIpv6boolEnablePrimaryIpv6interface{}#notes
A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if the instance that this ENI will be attached to relies on its IPv6 address not changing. AWS will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.
groupSetstring | ISecurityGroupRef[]group_settyping.List[typing.Union[str, ISecurityGroupRef]]groupSetList<String>GroupSetstring[]GroupSet*[]interface{}#The default is interface . The supported values are efa and trunk .
ipv4PrefixCountnumberipv4_prefix_countint | floatipv4PrefixCountNumberIpv4PrefixCountdoubleIpv4PrefixCount*float64#When creating a network interface, you can't specify a count of IPv4 prefixes if you've specified one of the following: specific IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 addresses.
ipv4PrefixesIResolvable | IResolvable | CfnNetworkInterface.Ipv4PrefixSpecificationProperty[]ipv4_prefixestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, Ipv4PrefixSpecificationProperty]]]ipv4PrefixesIResolvableIpv4PrefixesIResolvableIpv4Prefixesinterface{}#When creating a network interface, you can't specify IPv4 prefixes if you've specified one of the following: a count of IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 addresses.
ipv6AddressCountnumberipv6_address_countint | floatipv6AddressCountNumberIpv6AddressCountdoubleIpv6AddressCount*float64#notes
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.
When creating a network interface, you can't specify a count of IPv6 addresses if you've specified one of the following: specific IPv6 addresses, specific IPv6 prefixes, or a count of IPv6 prefixes.
ipv6AddressesIResolvable | IResolvable | CfnNetworkInterface.InstanceIpv6AddressProperty[]ipv6_addressestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, InstanceIpv6AddressProperty]]]ipv6AddressesIResolvableIpv6AddressesIResolvableIpv6Addressesinterface{}#notes
If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don't specify this property.
When creating a network interface, you can't specify IPv6 addresses if you've specified one of the following: a count of IPv6 addresses, specific IPv6 prefixes, or a count of IPv6 prefixes.
ipv6PrefixCountnumberipv6_prefix_countint | floatipv6PrefixCountNumberIpv6PrefixCountdoubleIpv6PrefixCount*float64#When creating a network interface, you can't specify a count of IPv6 prefixes if you've specified one of the following: specific IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses.
ipv6PrefixesIResolvable | IResolvable | CfnNetworkInterface.Ipv6PrefixSpecificationProperty[]ipv6_prefixestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, Ipv6PrefixSpecificationProperty]]]ipv6PrefixesIResolvableIpv6PrefixesIResolvableIpv6Prefixesinterface{}#When creating a network interface, you can't specify IPv6 prefixes if you've specified one of the following: a count of IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses.
privateIpAddressstringprivate_ip_addressstrprivateIpAddressStringPrivateIpAddressstringPrivateIpAddress*string#If you want to specify multiple private IP addresses, use the PrivateIpAddresses property.
privateIpAddressesIResolvable | IResolvable | CfnNetworkInterface.PrivateIpAddressSpecificationProperty[]private_ip_addressestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, PrivateIpAddressSpecificationProperty]]]privateIpAddressesIResolvablePrivateIpAddressesIResolvablePrivateIpAddressesinterface{}#notes
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.
When creating a network interface, you can't specify private IPv4 addresses if you've specified one of the following: a count of private IPv4 addresses, specific IPv4 prefixes, or a count of IPv4 prefixes.
publicIpDnsHostnameTypeSpecificationstringpublic_ip_dns_hostname_type_specificationstrpublicIpDnsHostnameTypeSpecificationStringPublicIpDnsHostnameTypeSpecificationstringPublicIpDnsHostnameTypeSpecification*string#secondaryPrivateIpAddressCountnumbersecondary_private_ip_address_countint | floatsecondaryPrivateIpAddressCountNumberSecondaryPrivateIpAddressCountdoubleSecondaryPrivateIpAddressCount*float64#notes
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 .
When creating a Network Interface, you can't specify a count of private IPv4 addresses if you've specified one of the following: specific private IPv4 addresses, specific IPv4 prefixes, or a count of IPv4 prefixes.
sourceDestCheckboolean | IResolvablesource_dest_checktyping.Union[bool, IResolvable]sourceDestCheckBooleanSourceDestCheckboolSourceDestCheckinterface{}#notes
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.
subnetIdstring | ISubnetRefsubnet_idtyping.Union[str, ISubnetRef]subnetIdStringSubnetIdstringSubnetIdinterface{}required#