1. Packages
  2. Packages
  3. AWS
  4. API Docs
  5. ec2
  6. NetworkInterface
Viewing docs for AWS v7.27.0
published on Thursday, Apr 23, 2026 by Pulumi
aws logo
Viewing docs for AWS v7.27.0
published on Thursday, Apr 23, 2026 by Pulumi

    Provides an Elastic network interface (ENI) resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const test = new aws.ec2.NetworkInterface("test", {
        subnetId: publicA.id,
        privateIps: ["10.0.0.50"],
        securityGroups: [web.id],
        attachments: [{
            instance: testAwsInstance.id,
            deviceIndex: 1,
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    test = aws.ec2.NetworkInterface("test",
        subnet_id=public_a["id"],
        private_ips=["10.0.0.50"],
        security_groups=[web["id"]],
        attachments=[{
            "instance": test_aws_instance["id"],
            "device_index": 1,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2.NewNetworkInterface(ctx, "test", &ec2.NetworkInterfaceArgs{
    			SubnetId: pulumi.Any(publicA.Id),
    			PrivateIps: pulumi.StringArray{
    				pulumi.String("10.0.0.50"),
    			},
    			SecurityGroups: pulumi.StringArray{
    				web.Id,
    			},
    			Attachments: ec2.NetworkInterfaceAttachmentTypeArray{
    				&ec2.NetworkInterfaceAttachmentTypeArgs{
    					Instance:    pulumi.Any(testAwsInstance.Id),
    					DeviceIndex: pulumi.Int(1),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Aws.Ec2.NetworkInterface("test", new()
        {
            SubnetId = publicA.Id,
            PrivateIps = new[]
            {
                "10.0.0.50",
            },
            SecurityGroups = new[]
            {
                web.Id,
            },
            Attachments = new[]
            {
                new Aws.Ec2.Inputs.NetworkInterfaceAttachmentArgs
                {
                    Instance = testAwsInstance.Id,
                    DeviceIndex = 1,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.NetworkInterface;
    import com.pulumi.aws.ec2.NetworkInterfaceArgs;
    import com.pulumi.aws.ec2.inputs.NetworkInterfaceAttachmentArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var test = new NetworkInterface("test", NetworkInterfaceArgs.builder()
                .subnetId(publicA.id())
                .privateIps("10.0.0.50")
                .securityGroups(web.id())
                .attachments(NetworkInterfaceAttachmentArgs.builder()
                    .instance(testAwsInstance.id())
                    .deviceIndex(1)
                    .build())
                .build());
    
        }
    }
    
    resources:
      test:
        type: aws:ec2:NetworkInterface
        properties:
          subnetId: ${publicA.id}
          privateIps:
            - 10.0.0.50
          securityGroups:
            - ${web.id}
          attachments:
            - instance: ${testAwsInstance.id}
              deviceIndex: 1
    

    Example of Managing Multiple IPs on a Network Interface

    By default, private IPs are managed through the privateIps and privateIpsCount arguments which manage IPs as a set of IPs that are configured without regard to order. For a new network interface, the same primary IP address is consistently selected from a given set of addresses, regardless of the order provided. However, modifications of the set of addresses of an existing interface will not alter the current primary IP address unless it has been removed from the set.

    In order to manage the private IPs as a sequentially ordered list, configure privateIpListEnabled to true and use privateIpList to manage the IPs. This will disable the privateIps and privateIpsCount settings, which must be removed from the config file but are still exported. Note that changing the first address of privateIpList, which is the primary, always requires a new interface.

    If you are managing a specific set or list of IPs, instead of just using privateIpsCount, this is a potential workflow for also leveraging privateIpsCount to have AWS automatically assign additional IP addresses:

    1. Comment out privateIps, privateIpList, privateIpListEnabled in your configuration
    2. Set the desired privateIpsCount (count of the number of secondaries, the primary is not included)
    3. Apply to assign the extra IPs
    4. Remove privateIpsCount and restore your settings from the first step
    5. Add the new IPs to your current settings
    6. Apply again to update the stored state

    This process can also be used to remove IP addresses in addition to the option of manually removing them. Adding IP addresses in a manually is more difficult because it requires knowledge of which addresses are available.

    Create NetworkInterface Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new NetworkInterface(name: string, args: NetworkInterfaceArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkInterface(resource_name: str,
                         args: NetworkInterfaceArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkInterface(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         subnet_id: Optional[str] = None,
                         ipv6_addresses: Optional[Sequence[str]] = None,
                         ipv6_prefixes: Optional[Sequence[str]] = None,
                         enable_primary_ipv6: Optional[bool] = None,
                         interface_type: Optional[str] = None,
                         ipv4_prefix_count: Optional[int] = None,
                         ipv4_prefixes: Optional[Sequence[str]] = None,
                         ipv6_address_count: Optional[int] = None,
                         ipv6_address_list_enabled: Optional[bool] = None,
                         ipv6_address_lists: Optional[Sequence[str]] = None,
                         private_ip: Optional[str] = None,
                         ena_srd_specification: Optional[NetworkInterfaceEnaSrdSpecificationArgs] = None,
                         ipv6_prefix_count: Optional[int] = None,
                         attachments: Optional[Sequence[NetworkInterfaceAttachmentArgs]] = None,
                         private_ip_list_enabled: Optional[bool] = None,
                         private_ip_lists: Optional[Sequence[str]] = None,
                         private_ips: Optional[Sequence[str]] = None,
                         private_ips_count: Optional[int] = None,
                         region: Optional[str] = None,
                         security_groups: Optional[Sequence[str]] = None,
                         source_dest_check: Optional[bool] = None,
                         description: Optional[str] = None,
                         tags: Optional[Mapping[str, str]] = None)
    func NewNetworkInterface(ctx *Context, name string, args NetworkInterfaceArgs, opts ...ResourceOption) (*NetworkInterface, error)
    public NetworkInterface(string name, NetworkInterfaceArgs args, CustomResourceOptions? opts = null)
    public NetworkInterface(String name, NetworkInterfaceArgs args)
    public NetworkInterface(String name, NetworkInterfaceArgs args, CustomResourceOptions options)
    
    type: aws:ec2:NetworkInterface
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    NetworkInterface Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The NetworkInterface resource accepts the following input properties:

    SubnetId string

    Subnet ID to create the ENI in.

    The following arguments are optional:

    Attachments List<NetworkInterfaceAttachment>
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    Description string
    Description for the network interface.
    EnaSrdSpecification NetworkInterfaceEnaSrdSpecification
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    EnablePrimaryIpv6 bool
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    InterfaceType string
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    Ipv4PrefixCount int
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    Ipv4Prefixes List<string>
    One or more IPv4 prefixes assigned to the network interface.
    Ipv6AddressCount int
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    Ipv6AddressListEnabled bool
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    Ipv6AddressLists List<string>
    List of private IPs to assign to the ENI in sequential order.
    Ipv6Addresses List<string>
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    Ipv6PrefixCount int
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    Ipv6Prefixes List<string>
    One or more IPv6 prefixes assigned to the network interface.
    PrivateIp string
    PrivateIpListEnabled bool
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    PrivateIpLists List<string>
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    PrivateIps List<string>
    List of private IPs to assign to the ENI without regard to order.
    PrivateIpsCount int
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SecurityGroups List<string>
    List of security group IDs to assign to the ENI.
    SourceDestCheck bool
    Whether to enable source destination checking for the ENI. Default true.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    SubnetId string

    Subnet ID to create the ENI in.

    The following arguments are optional:

    Attachments []NetworkInterfaceAttachmentTypeArgs
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    Description string
    Description for the network interface.
    EnaSrdSpecification NetworkInterfaceEnaSrdSpecificationArgs
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    EnablePrimaryIpv6 bool
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    InterfaceType string
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    Ipv4PrefixCount int
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    Ipv4Prefixes []string
    One or more IPv4 prefixes assigned to the network interface.
    Ipv6AddressCount int
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    Ipv6AddressListEnabled bool
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    Ipv6AddressLists []string
    List of private IPs to assign to the ENI in sequential order.
    Ipv6Addresses []string
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    Ipv6PrefixCount int
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    Ipv6Prefixes []string
    One or more IPv6 prefixes assigned to the network interface.
    PrivateIp string
    PrivateIpListEnabled bool
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    PrivateIpLists []string
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    PrivateIps []string
    List of private IPs to assign to the ENI without regard to order.
    PrivateIpsCount int
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SecurityGroups []string
    List of security group IDs to assign to the ENI.
    SourceDestCheck bool
    Whether to enable source destination checking for the ENI. Default true.
    Tags map[string]string
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    subnetId String

    Subnet ID to create the ENI in.

    The following arguments are optional:

    attachments List<NetworkInterfaceAttachment>
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    description String
    Description for the network interface.
    enaSrdSpecification NetworkInterfaceEnaSrdSpecification
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    enablePrimaryIpv6 Boolean
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    interfaceType String
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    ipv4PrefixCount Integer
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    ipv4Prefixes List<String>
    One or more IPv4 prefixes assigned to the network interface.
    ipv6AddressCount Integer
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    ipv6AddressListEnabled Boolean
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    ipv6AddressLists List<String>
    List of private IPs to assign to the ENI in sequential order.
    ipv6Addresses List<String>
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    ipv6PrefixCount Integer
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    ipv6Prefixes List<String>
    One or more IPv6 prefixes assigned to the network interface.
    privateIp String
    privateIpListEnabled Boolean
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    privateIpLists List<String>
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    privateIps List<String>
    List of private IPs to assign to the ENI without regard to order.
    privateIpsCount Integer
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    securityGroups List<String>
    List of security group IDs to assign to the ENI.
    sourceDestCheck Boolean
    Whether to enable source destination checking for the ENI. Default true.
    tags Map<String,String>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    subnetId string

    Subnet ID to create the ENI in.

    The following arguments are optional:

    attachments NetworkInterfaceAttachment[]
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    description string
    Description for the network interface.
    enaSrdSpecification NetworkInterfaceEnaSrdSpecification
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    enablePrimaryIpv6 boolean
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    interfaceType string
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    ipv4PrefixCount number
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    ipv4Prefixes string[]
    One or more IPv4 prefixes assigned to the network interface.
    ipv6AddressCount number
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    ipv6AddressListEnabled boolean
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    ipv6AddressLists string[]
    List of private IPs to assign to the ENI in sequential order.
    ipv6Addresses string[]
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    ipv6PrefixCount number
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    ipv6Prefixes string[]
    One or more IPv6 prefixes assigned to the network interface.
    privateIp string
    privateIpListEnabled boolean
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    privateIpLists string[]
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    privateIps string[]
    List of private IPs to assign to the ENI without regard to order.
    privateIpsCount number
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    securityGroups string[]
    List of security group IDs to assign to the ENI.
    sourceDestCheck boolean
    Whether to enable source destination checking for the ENI. Default true.
    tags {[key: string]: string}
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    subnet_id str

    Subnet ID to create the ENI in.

    The following arguments are optional:

    attachments Sequence[NetworkInterfaceAttachmentArgs]
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    description str
    Description for the network interface.
    ena_srd_specification NetworkInterfaceEnaSrdSpecificationArgs
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    enable_primary_ipv6 bool
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    interface_type str
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    ipv4_prefix_count int
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    ipv4_prefixes Sequence[str]
    One or more IPv4 prefixes assigned to the network interface.
    ipv6_address_count int
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    ipv6_address_list_enabled bool
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    ipv6_address_lists Sequence[str]
    List of private IPs to assign to the ENI in sequential order.
    ipv6_addresses Sequence[str]
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    ipv6_prefix_count int
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    ipv6_prefixes Sequence[str]
    One or more IPv6 prefixes assigned to the network interface.
    private_ip str
    private_ip_list_enabled bool
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    private_ip_lists Sequence[str]
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    private_ips Sequence[str]
    List of private IPs to assign to the ENI without regard to order.
    private_ips_count int
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    security_groups Sequence[str]
    List of security group IDs to assign to the ENI.
    source_dest_check bool
    Whether to enable source destination checking for the ENI. Default true.
    tags Mapping[str, str]
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    subnetId String

    Subnet ID to create the ENI in.

    The following arguments are optional:

    attachments List<Property Map>
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    description String
    Description for the network interface.
    enaSrdSpecification Property Map
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    enablePrimaryIpv6 Boolean
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    interfaceType String
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    ipv4PrefixCount Number
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    ipv4Prefixes List<String>
    One or more IPv4 prefixes assigned to the network interface.
    ipv6AddressCount Number
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    ipv6AddressListEnabled Boolean
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    ipv6AddressLists List<String>
    List of private IPs to assign to the ENI in sequential order.
    ipv6Addresses List<String>
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    ipv6PrefixCount Number
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    ipv6Prefixes List<String>
    One or more IPv6 prefixes assigned to the network interface.
    privateIp String
    privateIpListEnabled Boolean
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    privateIpLists List<String>
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    privateIps List<String>
    List of private IPs to assign to the ENI without regard to order.
    privateIpsCount Number
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    securityGroups List<String>
    List of security group IDs to assign to the ENI.
    sourceDestCheck Boolean
    Whether to enable source destination checking for the ENI. Default true.
    tags Map<String>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NetworkInterface resource produces the following output properties:

    Arn string
    ARN of the network interface.
    Id string
    The provider-assigned unique ID for this managed resource.
    MacAddress string
    MAC address of the network interface.
    OutpostArn string
    OwnerId string
    AWS account ID of the owner of the network interface.
    PrivateDnsName string
    Private DNS name of the network interface (IPv4).
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    Arn string
    ARN of the network interface.
    Id string
    The provider-assigned unique ID for this managed resource.
    MacAddress string
    MAC address of the network interface.
    OutpostArn string
    OwnerId string
    AWS account ID of the owner of the network interface.
    PrivateDnsName string
    Private DNS name of the network interface (IPv4).
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn String
    ARN of the network interface.
    id String
    The provider-assigned unique ID for this managed resource.
    macAddress String
    MAC address of the network interface.
    outpostArn String
    ownerId String
    AWS account ID of the owner of the network interface.
    privateDnsName String
    Private DNS name of the network interface (IPv4).
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn string
    ARN of the network interface.
    id string
    The provider-assigned unique ID for this managed resource.
    macAddress string
    MAC address of the network interface.
    outpostArn string
    ownerId string
    AWS account ID of the owner of the network interface.
    privateDnsName string
    Private DNS name of the network interface (IPv4).
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn str
    ARN of the network interface.
    id str
    The provider-assigned unique ID for this managed resource.
    mac_address str
    MAC address of the network interface.
    outpost_arn str
    owner_id str
    AWS account ID of the owner of the network interface.
    private_dns_name str
    Private DNS name of the network interface (IPv4).
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn String
    ARN of the network interface.
    id String
    The provider-assigned unique ID for this managed resource.
    macAddress String
    MAC address of the network interface.
    outpostArn String
    ownerId String
    AWS account ID of the owner of the network interface.
    privateDnsName String
    Private DNS name of the network interface (IPv4).
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

    Look up Existing NetworkInterface Resource

    Get an existing NetworkInterface resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: NetworkInterfaceState, opts?: CustomResourceOptions): NetworkInterface
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            attachments: Optional[Sequence[NetworkInterfaceAttachmentArgs]] = None,
            description: Optional[str] = None,
            ena_srd_specification: Optional[NetworkInterfaceEnaSrdSpecificationArgs] = None,
            enable_primary_ipv6: Optional[bool] = None,
            interface_type: Optional[str] = None,
            ipv4_prefix_count: Optional[int] = None,
            ipv4_prefixes: Optional[Sequence[str]] = None,
            ipv6_address_count: Optional[int] = None,
            ipv6_address_list_enabled: Optional[bool] = None,
            ipv6_address_lists: Optional[Sequence[str]] = None,
            ipv6_addresses: Optional[Sequence[str]] = None,
            ipv6_prefix_count: Optional[int] = None,
            ipv6_prefixes: Optional[Sequence[str]] = None,
            mac_address: Optional[str] = None,
            outpost_arn: Optional[str] = None,
            owner_id: Optional[str] = None,
            private_dns_name: Optional[str] = None,
            private_ip: Optional[str] = None,
            private_ip_list_enabled: Optional[bool] = None,
            private_ip_lists: Optional[Sequence[str]] = None,
            private_ips: Optional[Sequence[str]] = None,
            private_ips_count: Optional[int] = None,
            region: Optional[str] = None,
            security_groups: Optional[Sequence[str]] = None,
            source_dest_check: Optional[bool] = None,
            subnet_id: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> NetworkInterface
    func GetNetworkInterface(ctx *Context, name string, id IDInput, state *NetworkInterfaceState, opts ...ResourceOption) (*NetworkInterface, error)
    public static NetworkInterface Get(string name, Input<string> id, NetworkInterfaceState? state, CustomResourceOptions? opts = null)
    public static NetworkInterface get(String name, Output<String> id, NetworkInterfaceState state, CustomResourceOptions options)
    resources:  _:    type: aws:ec2:NetworkInterface    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Arn string
    ARN of the network interface.
    Attachments List<NetworkInterfaceAttachment>
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    Description string
    Description for the network interface.
    EnaSrdSpecification NetworkInterfaceEnaSrdSpecification
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    EnablePrimaryIpv6 bool
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    InterfaceType string
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    Ipv4PrefixCount int
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    Ipv4Prefixes List<string>
    One or more IPv4 prefixes assigned to the network interface.
    Ipv6AddressCount int
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    Ipv6AddressListEnabled bool
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    Ipv6AddressLists List<string>
    List of private IPs to assign to the ENI in sequential order.
    Ipv6Addresses List<string>
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    Ipv6PrefixCount int
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    Ipv6Prefixes List<string>
    One or more IPv6 prefixes assigned to the network interface.
    MacAddress string
    MAC address of the network interface.
    OutpostArn string
    OwnerId string
    AWS account ID of the owner of the network interface.
    PrivateDnsName string
    Private DNS name of the network interface (IPv4).
    PrivateIp string
    PrivateIpListEnabled bool
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    PrivateIpLists List<string>
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    PrivateIps List<string>
    List of private IPs to assign to the ENI without regard to order.
    PrivateIpsCount int
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SecurityGroups List<string>
    List of security group IDs to assign to the ENI.
    SourceDestCheck bool
    Whether to enable source destination checking for the ENI. Default true.
    SubnetId string

    Subnet ID to create the ENI in.

    The following arguments are optional:

    Tags Dictionary<string, string>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    Arn string
    ARN of the network interface.
    Attachments []NetworkInterfaceAttachmentTypeArgs
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    Description string
    Description for the network interface.
    EnaSrdSpecification NetworkInterfaceEnaSrdSpecificationArgs
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    EnablePrimaryIpv6 bool
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    InterfaceType string
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    Ipv4PrefixCount int
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    Ipv4Prefixes []string
    One or more IPv4 prefixes assigned to the network interface.
    Ipv6AddressCount int
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    Ipv6AddressListEnabled bool
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    Ipv6AddressLists []string
    List of private IPs to assign to the ENI in sequential order.
    Ipv6Addresses []string
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    Ipv6PrefixCount int
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    Ipv6Prefixes []string
    One or more IPv6 prefixes assigned to the network interface.
    MacAddress string
    MAC address of the network interface.
    OutpostArn string
    OwnerId string
    AWS account ID of the owner of the network interface.
    PrivateDnsName string
    Private DNS name of the network interface (IPv4).
    PrivateIp string
    PrivateIpListEnabled bool
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    PrivateIpLists []string
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    PrivateIps []string
    List of private IPs to assign to the ENI without regard to order.
    PrivateIpsCount int
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SecurityGroups []string
    List of security group IDs to assign to the ENI.
    SourceDestCheck bool
    Whether to enable source destination checking for the ENI. Default true.
    SubnetId string

    Subnet ID to create the ENI in.

    The following arguments are optional:

    Tags map[string]string
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn String
    ARN of the network interface.
    attachments List<NetworkInterfaceAttachment>
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    description String
    Description for the network interface.
    enaSrdSpecification NetworkInterfaceEnaSrdSpecification
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    enablePrimaryIpv6 Boolean
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    interfaceType String
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    ipv4PrefixCount Integer
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    ipv4Prefixes List<String>
    One or more IPv4 prefixes assigned to the network interface.
    ipv6AddressCount Integer
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    ipv6AddressListEnabled Boolean
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    ipv6AddressLists List<String>
    List of private IPs to assign to the ENI in sequential order.
    ipv6Addresses List<String>
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    ipv6PrefixCount Integer
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    ipv6Prefixes List<String>
    One or more IPv6 prefixes assigned to the network interface.
    macAddress String
    MAC address of the network interface.
    outpostArn String
    ownerId String
    AWS account ID of the owner of the network interface.
    privateDnsName String
    Private DNS name of the network interface (IPv4).
    privateIp String
    privateIpListEnabled Boolean
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    privateIpLists List<String>
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    privateIps List<String>
    List of private IPs to assign to the ENI without regard to order.
    privateIpsCount Integer
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    securityGroups List<String>
    List of security group IDs to assign to the ENI.
    sourceDestCheck Boolean
    Whether to enable source destination checking for the ENI. Default true.
    subnetId String

    Subnet ID to create the ENI in.

    The following arguments are optional:

    tags Map<String,String>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn string
    ARN of the network interface.
    attachments NetworkInterfaceAttachment[]
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    description string
    Description for the network interface.
    enaSrdSpecification NetworkInterfaceEnaSrdSpecification
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    enablePrimaryIpv6 boolean
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    interfaceType string
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    ipv4PrefixCount number
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    ipv4Prefixes string[]
    One or more IPv4 prefixes assigned to the network interface.
    ipv6AddressCount number
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    ipv6AddressListEnabled boolean
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    ipv6AddressLists string[]
    List of private IPs to assign to the ENI in sequential order.
    ipv6Addresses string[]
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    ipv6PrefixCount number
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    ipv6Prefixes string[]
    One or more IPv6 prefixes assigned to the network interface.
    macAddress string
    MAC address of the network interface.
    outpostArn string
    ownerId string
    AWS account ID of the owner of the network interface.
    privateDnsName string
    Private DNS name of the network interface (IPv4).
    privateIp string
    privateIpListEnabled boolean
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    privateIpLists string[]
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    privateIps string[]
    List of private IPs to assign to the ENI without regard to order.
    privateIpsCount number
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    securityGroups string[]
    List of security group IDs to assign to the ENI.
    sourceDestCheck boolean
    Whether to enable source destination checking for the ENI. Default true.
    subnetId string

    Subnet ID to create the ENI in.

    The following arguments are optional:

    tags {[key: string]: string}
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn str
    ARN of the network interface.
    attachments Sequence[NetworkInterfaceAttachmentArgs]
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    description str
    Description for the network interface.
    ena_srd_specification NetworkInterfaceEnaSrdSpecificationArgs
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    enable_primary_ipv6 bool
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    interface_type str
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    ipv4_prefix_count int
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    ipv4_prefixes Sequence[str]
    One or more IPv4 prefixes assigned to the network interface.
    ipv6_address_count int
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    ipv6_address_list_enabled bool
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    ipv6_address_lists Sequence[str]
    List of private IPs to assign to the ENI in sequential order.
    ipv6_addresses Sequence[str]
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    ipv6_prefix_count int
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    ipv6_prefixes Sequence[str]
    One or more IPv6 prefixes assigned to the network interface.
    mac_address str
    MAC address of the network interface.
    outpost_arn str
    owner_id str
    AWS account ID of the owner of the network interface.
    private_dns_name str
    Private DNS name of the network interface (IPv4).
    private_ip str
    private_ip_list_enabled bool
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    private_ip_lists Sequence[str]
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    private_ips Sequence[str]
    List of private IPs to assign to the ENI without regard to order.
    private_ips_count int
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    security_groups Sequence[str]
    List of security group IDs to assign to the ENI.
    source_dest_check bool
    Whether to enable source destination checking for the ENI. Default true.
    subnet_id str

    Subnet ID to create the ENI in.

    The following arguments are optional:

    tags Mapping[str, str]
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn String
    ARN of the network interface.
    attachments List<Property Map>
    Configuration block to define the attachment of the ENI. See Attachment below for more details!
    description String
    Description for the network interface.
    enaSrdSpecification Property Map
    Configures ENA Express for the network interface. The ENI must be attached to an instance to configure ENA Express. See ENA SRD Specification below for more details.
    enablePrimaryIpv6 Boolean
    Enables assigning a primary IPv6 Global Unicast Address (GUA) to the network interface (ENI) in dual-stack or IPv6-only subnets. This ensures the instance attached to the ENI retains a consistent IPv6 address. Once enabled, the first IPv6 GUA becomes the primary IPv6 address and cannot be disabled. The primary IPv6 address remains assigned until the instance is terminated or the ENI is detached. Enabling and subsequent disabling forces recreation of the ENI.
    interfaceType String
    Type of network interface to create. Set to efa for Elastic Fabric Adapter. Changing interfaceType will cause the resource to be destroyed and re-created.
    ipv4PrefixCount Number
    Number of IPv4 prefixes that AWS automatically assigns to the network interface.
    ipv4Prefixes List<String>
    One or more IPv4 prefixes assigned to the network interface.
    ipv6AddressCount Number
    Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific ipv6Addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.
    ipv6AddressListEnabled Boolean
    Whether ipv6AddressList is allowed and controls the IPs to assign to the ENI and ipv6Addresses and ipv6AddressCount become read-only. Default is false.
    ipv6AddressLists List<String>
    List of private IPs to assign to the ENI in sequential order.
    ipv6Addresses List<String>
    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying ipv6AddressCount.
    ipv6PrefixCount Number
    Number of IPv6 prefixes that AWS automatically assigns to the network interface.
    ipv6Prefixes List<String>
    One or more IPv6 prefixes assigned to the network interface.
    macAddress String
    MAC address of the network interface.
    outpostArn String
    ownerId String
    AWS account ID of the owner of the network interface.
    privateDnsName String
    Private DNS name of the network interface (IPv4).
    privateIp String
    privateIpListEnabled Boolean
    Whether privateIpList is allowed and controls the IPs to assign to the ENI and privateIps and privateIpsCount become read-only. Default is false.
    privateIpLists List<String>
    List of private IPs to assign to the ENI in sequential order. Requires setting privateIpListEnabled to true.
    privateIps List<String>
    List of private IPs to assign to the ENI without regard to order.
    privateIpsCount Number
    Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 + privateIpsCount, as a primary private IP will be assiged to an ENI by default.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    securityGroups List<String>
    List of security group IDs to assign to the ENI.
    sourceDestCheck Boolean
    Whether to enable source destination checking for the ENI. Default true.
    subnetId String

    Subnet ID to create the ENI in.

    The following arguments are optional:

    tags Map<String>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

    Supporting Types

    NetworkInterfaceAttachment, NetworkInterfaceAttachmentArgs

    DeviceIndex int
    Integer to define the devices index.
    Instance string
    ID of the instance to attach to.
    AttachmentId string
    NetworkCardIndex int
    Index of the network card. Specify a value greater than 0 when using multiple network cards, which are supported by some instance types. The default is 0.
    DeviceIndex int
    Integer to define the devices index.
    Instance string
    ID of the instance to attach to.
    AttachmentId string
    NetworkCardIndex int
    Index of the network card. Specify a value greater than 0 when using multiple network cards, which are supported by some instance types. The default is 0.
    deviceIndex Integer
    Integer to define the devices index.
    instance String
    ID of the instance to attach to.
    attachmentId String
    networkCardIndex Integer
    Index of the network card. Specify a value greater than 0 when using multiple network cards, which are supported by some instance types. The default is 0.
    deviceIndex number
    Integer to define the devices index.
    instance string
    ID of the instance to attach to.
    attachmentId string
    networkCardIndex number
    Index of the network card. Specify a value greater than 0 when using multiple network cards, which are supported by some instance types. The default is 0.
    device_index int
    Integer to define the devices index.
    instance str
    ID of the instance to attach to.
    attachment_id str
    network_card_index int
    Index of the network card. Specify a value greater than 0 when using multiple network cards, which are supported by some instance types. The default is 0.
    deviceIndex Number
    Integer to define the devices index.
    instance String
    ID of the instance to attach to.
    attachmentId String
    networkCardIndex Number
    Index of the network card. Specify a value greater than 0 when using multiple network cards, which are supported by some instance types. The default is 0.

    NetworkInterfaceEnaSrdSpecification, NetworkInterfaceEnaSrdSpecificationArgs

    EnaSrdEnabled bool
    Indicates whether ENA Express is enabled for the network interface.
    EnaSrdUdpSpecification NetworkInterfaceEnaSrdSpecificationEnaSrdUdpSpecification
    Configures ENA Express for UDP network traffic. See ENA SRD UDP Specification below for more details.
    EnaSrdEnabled bool
    Indicates whether ENA Express is enabled for the network interface.
    EnaSrdUdpSpecification NetworkInterfaceEnaSrdSpecificationEnaSrdUdpSpecification
    Configures ENA Express for UDP network traffic. See ENA SRD UDP Specification below for more details.
    enaSrdEnabled Boolean
    Indicates whether ENA Express is enabled for the network interface.
    enaSrdUdpSpecification NetworkInterfaceEnaSrdSpecificationEnaSrdUdpSpecification
    Configures ENA Express for UDP network traffic. See ENA SRD UDP Specification below for more details.
    enaSrdEnabled boolean
    Indicates whether ENA Express is enabled for the network interface.
    enaSrdUdpSpecification NetworkInterfaceEnaSrdSpecificationEnaSrdUdpSpecification
    Configures ENA Express for UDP network traffic. See ENA SRD UDP Specification below for more details.
    ena_srd_enabled bool
    Indicates whether ENA Express is enabled for the network interface.
    ena_srd_udp_specification NetworkInterfaceEnaSrdSpecificationEnaSrdUdpSpecification
    Configures ENA Express for UDP network traffic. See ENA SRD UDP Specification below for more details.
    enaSrdEnabled Boolean
    Indicates whether ENA Express is enabled for the network interface.
    enaSrdUdpSpecification Property Map
    Configures ENA Express for UDP network traffic. See ENA SRD UDP Specification below for more details.

    NetworkInterfaceEnaSrdSpecificationEnaSrdUdpSpecification, NetworkInterfaceEnaSrdSpecificationEnaSrdUdpSpecificationArgs

    EnaSrdUdpEnabled bool
    Indicates whether UDP traffic uses ENA Express. Requires enaSrdEnabled to be true.
    EnaSrdUdpEnabled bool
    Indicates whether UDP traffic uses ENA Express. Requires enaSrdEnabled to be true.
    enaSrdUdpEnabled Boolean
    Indicates whether UDP traffic uses ENA Express. Requires enaSrdEnabled to be true.
    enaSrdUdpEnabled boolean
    Indicates whether UDP traffic uses ENA Express. Requires enaSrdEnabled to be true.
    ena_srd_udp_enabled bool
    Indicates whether UDP traffic uses ENA Express. Requires enaSrdEnabled to be true.
    enaSrdUdpEnabled Boolean
    Indicates whether UDP traffic uses ENA Express. Requires enaSrdEnabled to be true.

    Import

    Using pulumi import, import Network Interfaces using the id. For example:

    $ pulumi import aws:ec2/networkInterface:NetworkInterface test eni-e5aa89a3
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v7.27.0
    published on Thursday, Apr 23, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.