aws-cdk-lib.aws_ec2.CfnNetworkInterfaceProps

interface CfnNetworkInterfaceProps

LanguageType name
.NETAmazon.CDK.AWS.EC2.CfnNetworkInterfaceProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#CfnNetworkInterfaceProps
Javasoftware.amazon.awscdk.services.ec2.CfnNetworkInterfaceProps
Pythonaws_cdk.aws_ec2.CfnNetworkInterfaceProps
TypeScript aws-cdk-lib » aws_ec2 » CfnNetworkInterfaceProps

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
  description: 'description',
  groupSet: ['groupSet'],
  interfaceType: 'interfaceType',
  ipv6AddressCount: 123,
  ipv6Addresses: [{
    ipv6Address: 'ipv6Address',
  }],
  privateIpAddress: 'privateIpAddress',
  privateIpAddresses: [{
    primary: false,
    privateIpAddress: 'privateIpAddress',
  }],
  secondaryPrivateIpAddressCount: 123,
  sourceDestCheck: false,
  tags: [{
    key: 'key',
    value: 'value',
  }],
};

Properties

NameTypeDescription
subnetIdstringThe ID of the subnet to associate with the network interface.
description?stringA description for the network interface.
groupSet?string[]The security group IDs associated with this network interface.
interfaceType?stringThe type of network interface.
ipv6AddressCount?numberThe number of IPv6 addresses to assign to a network interface.
ipv6Addresses?IResolvable | IResolvable | InstanceIpv6AddressProperty[]One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.
privateIpAddress?stringAssigns a single private IP address to the network interface, which is used as the primary private IP address.
privateIpAddresses?IResolvable | IResolvable | PrivateIpAddressSpecificationProperty[]Assigns private IP addresses to the network interface.
secondaryPrivateIpAddressCount?numberThe number of secondary private IPv4 addresses to assign to a network interface.
sourceDestCheck?boolean | IResolvableEnable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives.
tags?CfnTag[]An arbitrary set of tags (key-value pairs) for this network interface.

subnetId

Type: string

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


description?

Type: string (optional)

A description for the network interface.


groupSet?

Type: string[] (optional)

The security group IDs 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 .


ipv6AddressCount?

Type: number (optional)

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.


ipv6Addresses?

Type: IResolvable | IResolvable | InstanceIpv6AddressProperty[] (optional)

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.


privateIpAddress?

Type: string (optional)

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.


privateIpAddresses?

Type: IResolvable | IResolvable | PrivateIpAddressSpecificationProperty[] (optional)

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.


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 .

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: CfnTag[] (optional)

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