interface CfnNetworkInterfaceProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.CfnNetworkInterfaceProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#CfnNetworkInterfaceProps |
Java | software.amazon.awscdk.services.ec2.CfnNetworkInterfaceProps |
Python | aws_cdk.aws_ec2.CfnNetworkInterfaceProps |
TypeScript | aws-cdk-lib » aws_ec2 » CfnNetworkInterfaceProps |
Properties for defining a CfnNetworkInterface
.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html
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',
}],
secondaryPrivateIpAddressCount: 123,
sourceDestCheck: false,
tags: [{
key: 'key',
value: 'value',
}],
};
Properties
Name | Type | Description |
---|---|---|
subnet | string | The ID of the subnet to associate with the network interface. |
connection | IResolvable | Connection | A connection tracking specification for the network interface. |
description? | string | A description for the network interface. |
enable | boolean | IResolvable | If you’re modifying a network interface in a dual-stack or IPv6-only subnet, you have the option to assign a primary IPv6 IP address. |
group | string[] | The IDs of the security groups associated with this network interface. |
interface | string | The type of network interface. |
ipv4 | number | The number of IPv4 prefixes to be automatically assigned to the network interface. |
ipv4 | IResolvable | IResolvable | Ipv4 [] | The IPv4 delegated prefixes that are assigned to the network interface. |
ipv6 | number | The number of IPv6 addresses to assign to the network interface. |
ipv6 | IResolvable | IResolvable | Instance [] | The IPv6 addresses from the IPv6 CIDR block range of your subnet to assign to the network interface. |
ipv6 | number | The number of IPv6 prefixes to be automatically assigned to the network interface. |
ipv6 | IResolvable | IResolvable | Ipv6 [] | The IPv6 delegated prefixes that are assigned to the network interface. |
private | string | The private IPv4 address to assign to the network interface as the primary private IP address. |
private | IResolvable | IResolvable | Private [] | The private IPv4 addresses to assign to the network interface. |
secondary | number | The number of secondary private IPv4 addresses to assign to a network interface. |
source | boolean | IResolvable | Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives. |
tags? | Cfn [] | The tags to apply to the network interface. |
subnetId
Type:
string
The ID of the subnet to associate with the network interface.
connectionTrackingSpecification?
Type:
IResolvable
|
Connection
(optional)
A connection tracking specification for the network interface.
description?
Type:
string
(optional)
A description for the network interface.
enablePrimaryIpv6?
Type:
boolean |
IResolvable
(optional)
If you’re modifying a network interface in a dual-stack or IPv6-only subnet, you have the option to assign a primary IPv6 IP address.
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.
groupSet?
Type:
string[]
(optional)
The IDs of the security groups associated with this network interface.
interfaceType?
Type:
string
(optional)
The type of network interface.
The default is interface
. The supported values are efa
and trunk
.
ipv4PrefixCount?
Type:
number
(optional)
The number of IPv4 prefixes to be automatically assigned to the network interface.
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.
ipv4Prefixes?
Type:
IResolvable
|
IResolvable
|
Ipv4
[]
(optional)
The IPv4 delegated prefixes that are assigned to the network interface.
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.
ipv6AddressCount?
Type:
number
(optional)
The number of IPv6 addresses to assign to the 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.
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.
ipv6Addresses?
Type:
IResolvable
|
IResolvable
|
Instance
[]
(optional)
The IPv6 addresses from the IPv6 CIDR block range of your subnet to assign to the network interface.
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.
ipv6PrefixCount?
Type:
number
(optional)
The number of IPv6 prefixes to be automatically assigned to the network interface.
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.
ipv6Prefixes?
Type:
IResolvable
|
IResolvable
|
Ipv6
[]
(optional)
The IPv6 delegated prefixes that are assigned to the network interface.
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.
privateIpAddress?
Type:
string
(optional)
The private IPv4 address to assign to the network interface as the primary private IP address.
If you want to specify multiple private IP addresses, use the PrivateIpAddresses
property.
privateIpAddresses?
Type:
IResolvable
|
IResolvable
|
Private
[]
(optional)
The private IPv4 addresses to assign 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.
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.
secondaryPrivateIpAddressCount?
Type:
number
(optional)
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
.
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.
sourceDestCheck?
Type:
boolean |
IResolvable
(optional)
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?
Type:
Cfn
[]
(optional)
The tags to apply to the network interface.