1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. getNetworkInterface

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.ec2.getNetworkInterface

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getNetworkInterface:getNetworkInterface
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetNetworkInterfaceFilter>
    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.
    Tags Dictionary<string, string>
    Any tags assigned to the network interface.
    Filters []GetNetworkInterfaceFilter
    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.
    Tags map[string]string
    Any tags assigned to the network interface.
    filters List<GetNetworkInterfaceFilter>
    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.
    tags Map<String,String>
    Any tags assigned to the network interface.
    filters GetNetworkInterfaceFilter[]
    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.
    tags {[key: string]: string}
    Any tags assigned to the network interface.
    filters Sequence[GetNetworkInterfaceFilter]
    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.
    tags 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.
    tags 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<GetNetworkInterfaceAssociation>
    Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
    Attachments List<GetNetworkInterfaceAttachment>
    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.
    PrivateDnsName string
    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.
    Tags Dictionary<string, string>
    Any tags assigned to the network interface.
    VpcId string
    ID of the VPC.
    Filters List<GetNetworkInterfaceFilter>
    Arn string
    ARN of the network interface.
    Associations []GetNetworkInterfaceAssociation
    Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
    Attachments []GetNetworkInterfaceAttachmentType
    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.
    PrivateDnsName string
    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.
    Tags map[string]string
    Any tags assigned to the network interface.
    VpcId string
    ID of the VPC.
    Filters []GetNetworkInterfaceFilter
    arn String
    ARN of the network interface.
    associations List<GetNetworkInterfaceAssociation>
    Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
    attachments List<GetNetworkInterfaceAttachment>
    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.
    privateDnsName String
    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.
    tags Map<String,String>
    Any tags assigned to the network interface.
    vpcId String
    ID of the VPC.
    filters List<GetNetworkInterfaceFilter>
    arn string
    ARN of the network interface.
    associations GetNetworkInterfaceAssociation[]
    Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
    attachments GetNetworkInterfaceAttachment[]
    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.
    privateDnsName string
    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.
    tags {[key: string]: string}
    Any tags assigned to the network interface.
    vpcId string
    ID of the VPC.
    filters GetNetworkInterfaceFilter[]
    arn str
    ARN of the network interface.
    associations Sequence[GetNetworkInterfaceAssociation]
    Association information for an Elastic IP address (IPv4) associated with the network interface. See supported fields below.
    attachments Sequence[GetNetworkInterfaceAttachment]
    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_name str
    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.
    tags Mapping[str, str]
    Any tags assigned to the network interface.
    vpc_id str
    ID of the VPC.
    filters Sequence[GetNetworkInterfaceFilter]
    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.
    privateDnsName String
    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.
    tags 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.
    CustomerOwnedIp string
    Customer-owned IP address.
    IpOwnerId string
    ID of the Elastic IP address owner.
    PublicDnsName string
    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.
    CustomerOwnedIp string
    Customer-owned IP address.
    IpOwnerId string
    ID of the Elastic IP address owner.
    PublicDnsName string
    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.
    customerOwnedIp String
    Customer-owned IP address.
    ipOwnerId String
    ID of the Elastic IP address owner.
    publicDnsName String
    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.
    customerOwnedIp string
    Customer-owned IP address.
    ipOwnerId string
    ID of the Elastic IP address owner.
    publicDnsName string
    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_ip str
    Customer-owned IP address.
    ip_owner_id str
    ID of the Elastic IP address owner.
    public_dns_name str
    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.
    customerOwnedIp String
    Customer-owned IP address.
    ipOwnerId String
    ID of the Elastic IP address owner.
    publicDnsName String
    Public DNS name.
    publicIp String
    Address of the Elastic IP address bound to the network interface.

    GetNetworkInterfaceAttachment

    GetNetworkInterfaceFilter

    Name string
    Values List<string>
    Name string
    Values []string
    name String
    values List<String>
    name string
    values string[]
    name str
    values Sequence[str]
    name String
    values List<String>

    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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi