infoblox_network_view Data Source
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 |
---|---|---|
name | The name of the network view to be specified | custom_netview |
| A description of the network view. This is a regular comment. | The network view object in NIOS. |
| 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 retrieve information about 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:
Parameter | Description |
---|---|
name | Specifies the name of the network view. |
comment | Describes 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 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 "nview_res" {
value = data.infoblox_network_view.inet_nv
}
// accessing individual field in results
output "nview_name" { value = data.infoblox_network_view.inet_nv.results.0.name //zero represents index of json object from results list
}
//accessing IPv4 network through EAs
data "infoblox_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
}