Show / Hide Table of Contents

Class GetNetworkInterfaces

Inheritance
System.Object
GetNetworkInterfaces
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public static class GetNetworkInterfaces

Methods

View Source

InvokeAsync(GetNetworkInterfacesArgs, InvokeOptions)

{{% examples %}}

Example Usage

{{% example %}}

The following shows outputing all network interface ids in a region.

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var exampleNetworkInterfaces = Output.Create(Aws.Ec2.GetNetworkInterfaces.InvokeAsync());
    this.Example = exampleNetworkInterfaces.Apply(exampleNetworkInterfaces => exampleNetworkInterfaces.Ids);
}

[Output("example")]
public Output<string> Example { get; set; }
}

The following example retrieves a list of all network interface ids with a custom tag of Name set to a value of test.

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = Output.Create(Aws.Ec2.GetNetworkInterfaces.InvokeAsync(new Aws.Ec2.GetNetworkInterfacesArgs
    {
        Tags = 
        {
            { "Name", "test" },
        },
    }));
    this.Example1 = example.Apply(example => example.Ids);
}

[Output("example1")]
public Output<string> Example1 { get; set; }
}

The following example retrieves a network interface ids which associated with specific subnet.

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var exampleNetworkInterfaces = Output.Create(Aws.Ec2.GetNetworkInterfaces.InvokeAsync(new Aws.Ec2.GetNetworkInterfacesArgs
    {
        Filters = 
        {
            new Aws.Ec2.Inputs.GetNetworkInterfacesFilterArgs
            {
                Name = "subnet-id",
                Values = 
                {
                    aws_subnet.Test.Id,
                },
            },
        },
    }));
    this.Example = exampleNetworkInterfaces.Apply(exampleNetworkInterfaces => exampleNetworkInterfaces.Ids);
}

[Output("example")]
public Output<string> Example { get; set; }
}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetNetworkInterfacesResult> InvokeAsync(GetNetworkInterfacesArgs args = null, InvokeOptions options = null)
Parameters
Type Name Description
GetNetworkInterfacesArgs args
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetNetworkInterfacesResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.