---
title: "IPv4 Network Data Source"
canonical: "https://docs.infoblox.com/space/DeploymentGuideTerraformNIOSProvider/807076265/IPv4%20Network%20Data%20Source"
format: markdown
---
Data sources included in a Terraform provider allow you to retrieve data on existing resources and use this in your Terraform configurations. This example demonstrates a configuration file used to fetch/read  ipv4 network resource. The configuration will read a ipv4 network. In order for this configuration to be successfully applied, you will need to have an existing network already being present in the grid. Copy the below example into a text file and save as** network_ds.tf**. Replace the server, username, and password values with credentials from your Grid Master. Values used for other arguments such as CIDRs and names can be changed as desired for your environment. Lines that begin with # are comments explaining the resources and are not read when applying the configuration. The terraform and nested required provider block is required for Terraform version 0.13 and later.

```
# Terraform block containing the required providers block to install the Infoblox provider 
terraform {
  required_providers {
   infoblox = {
     source = "infobloxopen/infoblox" 
     version = "2.6.0"
    } 
  } 
} 
# Provider block for Infoblox credentials 
provider "infoblox" {
  server = "1.2.3.4"
  username = "admin"
  password = "infoblox" 
}
data "infoblox_ipv4_network" "nearby_network" {
    filters = {
      network = "192.168.128.0/20"
      network_view = "nondefault_netview"
    }
    # This is just to ensure that the network has been be created
    # using 'infoblox_ipv4_network' resource block before the data source will be queried.
    depends_on = [infoblox_ipv4_network.net2]
}
output "ipv4_net1" {
     value = data.infoblox_ipv4_network.nearby_network
}
# searching for IPv4 networks by specifying EA's
data "infoblox_ipv4_network" "ipv4_net_ea" {
    filters = {
      "*Site" = "Custom network site"
      "*Site!" = "Office network site"
    }
}
# retrieves matching IPv4 networks with EA, if any
output "net_ea_out" {
     value = data.infoblox_ipv4_network.ipv4_net_ea
}
```