AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi
aws.ec2.getNetworkInterface
Explore with Pulumi AI
Use this data source to get information about a Network Interface.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const bar = aws.ec2.getNetworkInterface({
    id: "eni-01234567",
});
import pulumi
import pulumi_aws as aws
bar = aws.ec2.get_network_interface(id="eni-01234567")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.LookupNetworkInterface(ctx, &ec2.LookupNetworkInterfaceArgs{
			Id: pulumi.StringRef("eni-01234567"),
		}, nil)
		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 bar = Aws.Ec2.GetNetworkInterface.Invoke(new()
    {
        Id = "eni-01234567",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetNetworkInterfaceArgs;
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) {
        final var bar = Ec2Functions.getNetworkInterface(GetNetworkInterfaceArgs.builder()
            .id("eni-01234567")
            .build());
    }
}
variables:
  bar:
    fn::invoke:
      function: aws:ec2:getNetworkInterface
      arguments:
        id: eni-01234567
Using getNetworkInterface
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNetworkInterface(args: GetNetworkInterfaceArgs, opts?: InvokeOptions): Promise<GetNetworkInterfaceResult>
function getNetworkInterfaceOutput(args: GetNetworkInterfaceOutputArgs, opts?: InvokeOptions): Output<GetNetworkInterfaceResult>def get_network_interface(filters: Optional[Sequence[GetNetworkInterfaceFilter]] = None,
                          id: Optional[str] = None,
                          tags: Optional[Mapping[str, str]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetNetworkInterfaceResult
def get_network_interface_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetNetworkInterfaceFilterArgs]]]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetNetworkInterfaceResult]func LookupNetworkInterface(ctx *Context, args *LookupNetworkInterfaceArgs, opts ...InvokeOption) (*LookupNetworkInterfaceResult, error)
func LookupNetworkInterfaceOutput(ctx *Context, args *LookupNetworkInterfaceOutputArgs, opts ...InvokeOption) LookupNetworkInterfaceResultOutput> Note: This function is named LookupNetworkInterface in the Go SDK.
public static class GetNetworkInterface 
{
    public static Task<GetNetworkInterfaceResult> InvokeAsync(GetNetworkInterfaceArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkInterfaceResult> Invoke(GetNetworkInterfaceInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNetworkInterfaceResult> getNetworkInterface(GetNetworkInterfaceArgs args, InvokeOptions options)
public static Output<GetNetworkInterfaceResult> getNetworkInterface(GetNetworkInterfaceArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ec2/getNetworkInterface:getNetworkInterface
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Filters
List<GetNetwork Interface Filter> 
- One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out describe-network-interfaces in the AWS CLI reference.
- Id string
- Identifier for the network interface.
- Dictionary<string, string>
- Any tags assigned to the network interface.
- Filters
[]GetNetwork Interface Filter 
- One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out describe-network-interfaces in the AWS CLI reference.
- Id string
- Identifier for the network interface.
- map[string]string
- Any tags assigned to the network interface.
- filters
List<GetNetwork Interface Filter> 
- One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out describe-network-interfaces in the AWS CLI reference.
- id String
- Identifier for the network interface.
- Map<String,String>
- Any tags assigned to the network interface.
- filters
GetNetwork Interface Filter[] 
- One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out describe-network-interfaces in the AWS CLI reference.
- id string
- Identifier for the network interface.
- {[key: string]: string}
- Any tags assigned to the network interface.
- filters
Sequence[GetNetwork Interface Filter] 
- One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out describe-network-interfaces in the AWS CLI reference.
- id str
- Identifier for the network interface.
- Mapping[str, str]
- Any tags assigned to the network interface.
- filters List<Property Map>
- One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out describe-network-interfaces in the AWS CLI reference.
- id String
- Identifier for the network interface.
- Map<String>
- Any tags assigned to the network interface.
getNetworkInterface Result
The following output properties are available:
- Arn string
- ARN of the network interface.
- Associations
List<GetNetwork Interface Association> 
- Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
- Attachments
List<GetNetwork Interface Attachment> 
- AvailabilityZone string
- Availability Zone.
- Description string
- Description of the network interface.
- Id string
- InterfaceType string
- Type of interface.
- Ipv6Addresses List<string>
- List of IPv6 addresses to assign to the ENI.
- MacAddress string
- MAC address.
- OutpostArn string
- ARN of the Outpost.
- OwnerId string
- AWS account ID of the owner of the network interface.
- PrivateDns stringName 
- Private DNS name.
- PrivateIp string
- Private IPv4 address of the network interface within the subnet.
- PrivateIps List<string>
- Private IPv4 addresses associated with the network interface.
- RequesterId string
- ID of the entity that launched the instance on your behalf.
- SecurityGroups List<string>
- List of security groups for the network interface.
- SubnetId string
- ID of the subnet.
- Dictionary<string, string>
- Any tags assigned to the network interface.
- VpcId string
- ID of the VPC.
- Filters
List<GetNetwork Interface Filter> 
- Arn string
- ARN of the network interface.
- Associations
[]GetNetwork Interface Association 
- Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
- Attachments
[]GetNetwork Interface Attachment Type 
- AvailabilityZone string
- Availability Zone.
- Description string
- Description of the network interface.
- Id string
- InterfaceType string
- Type of interface.
- Ipv6Addresses []string
- List of IPv6 addresses to assign to the ENI.
- MacAddress string
- MAC address.
- OutpostArn string
- ARN of the Outpost.
- OwnerId string
- AWS account ID of the owner of the network interface.
- PrivateDns stringName 
- Private DNS name.
- PrivateIp string
- Private IPv4 address of the network interface within the subnet.
- PrivateIps []string
- Private IPv4 addresses associated with the network interface.
- RequesterId string
- ID of the entity that launched the instance on your behalf.
- SecurityGroups []string
- List of security groups for the network interface.
- SubnetId string
- ID of the subnet.
- map[string]string
- Any tags assigned to the network interface.
- VpcId string
- ID of the VPC.
- Filters
[]GetNetwork Interface Filter 
- arn String
- ARN of the network interface.
- associations
List<GetNetwork Interface Association> 
- Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
- attachments
List<GetNetwork Interface Attachment> 
- availabilityZone String
- Availability Zone.
- description String
- Description of the network interface.
- id String
- interfaceType String
- Type of interface.
- ipv6Addresses List<String>
- List of IPv6 addresses to assign to the ENI.
- macAddress String
- MAC address.
- outpostArn String
- ARN of the Outpost.
- ownerId String
- AWS account ID of the owner of the network interface.
- privateDns StringName 
- Private DNS name.
- privateIp String
- Private IPv4 address of the network interface within the subnet.
- privateIps List<String>
- Private IPv4 addresses associated with the network interface.
- requesterId String
- ID of the entity that launched the instance on your behalf.
- securityGroups List<String>
- List of security groups for the network interface.
- subnetId String
- ID of the subnet.
- Map<String,String>
- Any tags assigned to the network interface.
- vpcId String
- ID of the VPC.
- filters
List<GetNetwork Interface Filter> 
- arn string
- ARN of the network interface.
- associations
GetNetwork Interface Association[] 
- Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
- attachments
GetNetwork Interface Attachment[] 
- availabilityZone string
- Availability Zone.
- description string
- Description of the network interface.
- id string
- interfaceType string
- Type of interface.
- ipv6Addresses string[]
- List of IPv6 addresses to assign to the ENI.
- macAddress string
- MAC address.
- outpostArn string
- ARN of the Outpost.
- ownerId string
- AWS account ID of the owner of the network interface.
- privateDns stringName 
- Private DNS name.
- privateIp string
- Private IPv4 address of the network interface within the subnet.
- privateIps string[]
- Private IPv4 addresses associated with the network interface.
- requesterId string
- ID of the entity that launched the instance on your behalf.
- securityGroups string[]
- List of security groups for the network interface.
- subnetId string
- ID of the subnet.
- {[key: string]: string}
- Any tags assigned to the network interface.
- vpcId string
- ID of the VPC.
- filters
GetNetwork Interface Filter[] 
- arn str
- ARN of the network interface.
- associations
Sequence[GetNetwork Interface Association] 
- Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
- attachments
Sequence[GetNetwork Interface Attachment] 
- availability_zone str
- Availability Zone.
- description str
- Description of the network interface.
- id str
- interface_type str
- Type of interface.
- ipv6_addresses Sequence[str]
- List of IPv6 addresses to assign to the ENI.
- mac_address str
- MAC address.
- outpost_arn str
- ARN of the Outpost.
- owner_id str
- AWS account ID of the owner of the network interface.
- private_dns_ strname 
- Private DNS name.
- private_ip str
- Private IPv4 address of the network interface within the subnet.
- private_ips Sequence[str]
- Private IPv4 addresses associated with the network interface.
- requester_id str
- ID of the entity that launched the instance on your behalf.
- security_groups Sequence[str]
- List of security groups for the network interface.
- subnet_id str
- ID of the subnet.
- Mapping[str, str]
- Any tags assigned to the network interface.
- vpc_id str
- ID of the VPC.
- filters
Sequence[GetNetwork Interface Filter] 
- arn String
- ARN of the network interface.
- associations List<Property Map>
- Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
- attachments List<Property Map>
- availabilityZone String
- Availability Zone.
- description String
- Description of the network interface.
- id String
- interfaceType String
- Type of interface.
- ipv6Addresses List<String>
- List of IPv6 addresses to assign to the ENI.
- macAddress String
- MAC address.
- outpostArn String
- ARN of the Outpost.
- ownerId String
- AWS account ID of the owner of the network interface.
- privateDns StringName 
- Private DNS name.
- privateIp String
- Private IPv4 address of the network interface within the subnet.
- privateIps List<String>
- Private IPv4 addresses associated with the network interface.
- requesterId String
- ID of the entity that launched the instance on your behalf.
- securityGroups List<String>
- List of security groups for the network interface.
- subnetId String
- ID of the subnet.
- Map<String>
- Any tags assigned to the network interface.
- vpcId String
- ID of the VPC.
- filters List<Property Map>
Supporting Types
GetNetworkInterfaceAssociation   
- AllocationId string
- Allocation ID.
- AssociationId string
- Association ID.
- CarrierIp string
- Carrier IP address associated with the network interface. This attribute is only set when the network interface is in a subnet which is associated with a Wavelength Zone.
- CustomerOwned stringIp 
- Customer-owned IP address.
- IpOwner stringId 
- ID of the Elastic IP address owner.
- PublicDns stringName 
- Public DNS name.
- PublicIp string
- Address of the Elastic IP address bound to the network interface.
- AllocationId string
- Allocation ID.
- AssociationId string
- Association ID.
- CarrierIp string
- Carrier IP address associated with the network interface. This attribute is only set when the network interface is in a subnet which is associated with a Wavelength Zone.
- CustomerOwned stringIp 
- Customer-owned IP address.
- IpOwner stringId 
- ID of the Elastic IP address owner.
- PublicDns stringName 
- Public DNS name.
- PublicIp string
- Address of the Elastic IP address bound to the network interface.
- allocationId String
- Allocation ID.
- associationId String
- Association ID.
- carrierIp String
- Carrier IP address associated with the network interface. This attribute is only set when the network interface is in a subnet which is associated with a Wavelength Zone.
- customerOwned StringIp 
- Customer-owned IP address.
- ipOwner StringId 
- ID of the Elastic IP address owner.
- publicDns StringName 
- Public DNS name.
- publicIp String
- Address of the Elastic IP address bound to the network interface.
- allocationId string
- Allocation ID.
- associationId string
- Association ID.
- carrierIp string
- Carrier IP address associated with the network interface. This attribute is only set when the network interface is in a subnet which is associated with a Wavelength Zone.
- customerOwned stringIp 
- Customer-owned IP address.
- ipOwner stringId 
- ID of the Elastic IP address owner.
- publicDns stringName 
- Public DNS name.
- publicIp string
- Address of the Elastic IP address bound to the network interface.
- allocation_id str
- Allocation ID.
- association_id str
- Association ID.
- carrier_ip str
- Carrier IP address associated with the network interface. This attribute is only set when the network interface is in a subnet which is associated with a Wavelength Zone.
- customer_owned_ strip 
- Customer-owned IP address.
- ip_owner_ strid 
- ID of the Elastic IP address owner.
- public_dns_ strname 
- Public DNS name.
- public_ip str
- Address of the Elastic IP address bound to the network interface.
- allocationId String
- Allocation ID.
- associationId String
- Association ID.
- carrierIp String
- Carrier IP address associated with the network interface. This attribute is only set when the network interface is in a subnet which is associated with a Wavelength Zone.
- customerOwned StringIp 
- Customer-owned IP address.
- ipOwner StringId 
- ID of the Elastic IP address owner.
- publicDns StringName 
- Public DNS name.
- publicIp String
- Address of the Elastic IP address bound to the network interface.
GetNetworkInterfaceAttachment   
- AttachmentId string
- DeviceIndex int
- InstanceId string
- InstanceOwner stringId 
- AttachmentId string
- DeviceIndex int
- InstanceId string
- InstanceOwner stringId 
- attachmentId String
- deviceIndex Integer
- instanceId String
- instanceOwner StringId 
- attachmentId string
- deviceIndex number
- instanceId string
- instanceOwner stringId 
- attachment_id str
- device_index int
- instance_id str
- instance_owner_ strid 
- attachmentId String
- deviceIndex Number
- instanceId String
- instanceOwner StringId 
GetNetworkInterfaceFilter   
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.