Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use the infoblox_network_view data source to retrieve the following information about a network view resource from the corresponding object in NIOS:

Parameter

Description

Example

nameThe name of the network view to be specifiedcustom_netview

comment

A description of the network view. This is a regular comment.

The network view object in NIOS.

ext_attrs

The set of extensible attributes of the network view, if any. The content is formatted as a string of JSON map.

{"Administrator": "jsw@telecom.ca"}

To get retrieve information about a network view, specify the name of network views that match the specified filters, use the filters argument and specify the parameters mentioned in the below table. These are the searchable parameters of the corresponding object in Infoblox NIOS WAPI. If you do not specify any parameter, the data source retrieves information about all network views in the NIOS Grid.

The following table describes the parameters you can define in the infoblox_network_view data source block:

ParameterDescription
nameSpecifies the name of the network view.
commentDescribes the network view.

Extensible Attributes

Specifies the extensible attributes specified for the network view. You must specify the key/value pair within the filters argument.
Example:
filters = {
"*Site" = "some test site"
}


Example of the Network View Data Source Block

The following is an example of an infoblox_network_view data source block:

resource "infoblox_network_view" "inet_nv" {
    name = "inet_visible_nv"
    comment = "Internet-facing networks"
    ext_attrs = jsonencode({
      "Location" = "the North pole"
})
}

data "infoblox_network_view" "inet_nv" {

    filters = {
      name = "inet_visible_nv"
    }
   
    // This is just to ensure that the network view has been be created
    // using 'infoblox_network_view' resource block before the data source will be queried.
    depends_on = [infoblox_network_view.inet_nv]

}

output "inet_nv_ext_attrsnview_res" {
    value = data data.infoblox_network_view.inet_nv.ext_attrs
}

// accessing individual field in results
output "inetnview_nv_commentname" {

    value = data data.infoblox_network_view.inet_nv.comment
}results.0.name //zero represents index of json object from results list
}


//accessing IPv4 network through EAs
data "infoblox_network_view" "netview1" {

    name = "one_more_network_view"nview_ea" {
    filters = {
      "*Administrator" = "jsw@telecom.ca"
      "*Location" = "65.8665701230204, -37.00791763398113"
      "*Location!" = "75.8665701230211"
    }

}

//retrieves matching Network Views with EA, if any
output "nview_ea_out" {

    value = data.infoblox_network_view.nview_ea
}