Data Source: aws_network_interfaces

Example Usage

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

data "aws_network_interfaces" "example" {}

output "example" {
  value = data.aws_network_interfaces.example.ids
}

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

data "aws_network_interfaces" "example" {
  tags = {
    Name = "test"
  }
}

output "example1" {
  value = data.aws_network_interfaces.example.ids
}

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

data "aws_network_interfaces" "example" {
  filter {
    name   = "subnet-id"
    values = [aws_subnet.test.id]
  }
}

output "example" {
  value = data.aws_network_interfaces.example.ids
}

Argument Reference

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

Attribute Reference

This data source exports the following attributes in addition to the arguments above:

Timeouts

Configuration options: