This resource enables you to perform create, update, and delete operations on IP networks. Network resources support the next available network feature by using the The following table describes the parameters you can define in a network resource block: Parameter Required/ Description Specifies the network view in which to create the network. Specifies the network block to use for the network, in CIDR notation. Specifies the network container from which the network must be dynamically allocated. It defines the length of the network part of the address for a network that should be allocated from a network container, which in turn is determined by It defines the IP address of the gateway within the network block.allocate_prefix_len
parameter listed in the below table.
Optionalnetwork_view
Optional
The default value is default
.cidr
Required only if parent_cidr
is not set
Do not use the IPv4 CIDR for IPv6 network and vice versa.parent_cidr
Required only if cidr
is not set
The network container must exist in the NIOS database, but not necessarily as a Terraform resource.allocate_prefix_len
Required only if parent_cidr
is setparent_cidr
.gateway
Optional
For more information, see Limitations.ext_attrs
Optional Specifies the set of NIOS extensible attributes that will be attached to the network.
Additionally, define the following parameter for the infoblox_ipv4_network
resource:
Parameter | Required/ | Description |
---|---|---|
| Optional | Specifies the number of IPv4 addresses that you want to reserve in the IPv4 network. |
Note
- Either
cidr
or the combination ofparent_cidr
andallocate_prefix_len
is required. The rest of the parameters are optional. - Once a network object is created, the
reserve_ip
andgateway
fields cannot be edited. - IP addresses that are reserved by setting the
reserve_ip
field are used for network maintenance by the cloud providers. Therefore, Infoblox does not recommend using these IP addresses for other purposes.
Examples of the Network Block
resource "infoblox_ipv4_network_container" "nc1" {
network_view = "default"
cidr = "10.0.0.0/16"
}
// A statically allocated network in a non-default network view.
resource "infoblox_ipv4_network" "nw1" { network_view = "very_special_network_view"
cidr = "10.0.0.0/24"
reserve_ip = 5
gateway = "10.0.0.6" comment = "mockup network"
ext_attrs = jsonencode({
"Tenant ID" = "tf-plugin"
"Cloud API Owned" = "True"
"CMP Type"= "VMware"
"Site" = "Nevada"
})}
resource "infoblox_ipv4_network" "nw2" {
// The 'network_view' attribute is omitted,
// thus is implied to be 'default'
parent_cidr = infoblox_ipv4_network_container.nc1.cidr
allocate_prefix_len = 30
ext_attrs = jsonencode({
"Tenant ID" = "tf-plugin"
"Cloud API Owned" = "True"
"CMP Type"= "VMware" "Custom EA 1" = "category 14"
})
}