Fetching Data for a Network Object
You can fetch information such as network ID (_ref) and name for a network from NIOS to Terraform using the infoblox_network
data source block.
The following table describes the parameters that are used to fetch the data:
Sr No. | Parameter | Mandatory/Optional | Description |
---|---|---|---|
1 | network_view_name | Optional | Specifies the network view name. If a network view is not specified, the provider considers the default network view. |
2 | network_name | Computed | Specifies the network name that is fetched from the data source. |
3 | cidr | Mandatory | Specifies the network block in cidr format. |
4 | tenant_id | Mandatory | Specifies the unique identifier of the tenant in the cloud in which the network exists. |
Example
As a prerequisite, you must have a network before you can fetch the data. If a network does not exist, use the infoblox_network
resource block to create a network as explained in Creating a Resource Network in a NIOS Appliance.
Use the data
block to fetch the data:
data "infoblox_network" "test"
{
cidr = infoblox_network.test.cidr #add a CIDR for which data needs to be fetched
tenant_id = "default"
}