Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

The data source for the network object allows you to get the following parameters for an IPv4 network resource:

Parameter

Description

Example

comment

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

Untrusted network

ext_attrs

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

{"Owner": "public internet caffe", "Administrator": "unknown"}

To get information about a network, you must specify the network address in the CIDR format.

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

Parameter

Required/Optional

Description

network_view

Optional

Specifies the network view in which the network container exists.
If a value is not specified, default will be used as the network view name.
If the network container is in a non-default network view, then you must specify that view.

cidr

Required

Specifies the network block that corresponds to the network, in CIDR notation. Do not use the IPv6 CIDR for an IPv4 network.

Example of an IPv4 Network Data Source Block

resource "infoblox_ipv4_network" "net2" {
    cidr = "192.168.128.0/20"
    network_view = "nondefault_netview"
    reserve_ip = 5
    gateway = "192.168.128.254"
    comment = "small network for testing"
    ext_attrs = jsonencode({
      "Site" = "bla-bla-bla... testing..."
    })
}

data "infoblox_ipv4_network" "nearby_network" {

    network_view = "nondefault_netview"
    cidr = 192.168.128.0/20
    // 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 "nearby_network_comment" {
    value
= data.infoblox_ipv4_network.nearby_network.comment
}

output "nearby_network_ext_attrs" {
    value
= data.infoblox_ipv4_network.nearby_network.ext_attrs
}


data "infoblox_ipv4_network" "net1" {
    cidr = 10.1.0.0/24
    network_view = "nondefault_netview"
}

  • No labels