Excerpt |
---|
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 allocate_prefix_len parameter listed in the below table. The following table describes the parameters you can define in a network resource block: Parameter | Required/ Optional | Description |
---|
network_view | Optional | Specifies the network view in which to create the network. The default value is default . | cidr | Required only if parent_cidr is not set | Specifies the network block to use for the network, in CIDR notation. Do not use the IPv4 CIDR for IPv6 network and vice versa. | parent_cidr | Required only if cidr is not set | Specifies the network container from which the network must be dynamically allocated. 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 set | 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 parent_cidr . | gateway | Optional | It defines the IP address of the gateway within the network block. 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/ Optional | Description |
---|
reserve_ip
| Optional | Specifies the number of IPv4 addresses that you want to reserve in the IPv4 network. The default value is 0 . |
Note |
---|
|
- Either
cidr or the combination of parent_cidr and allocate_prefix_len is required. The rest of the parameters are optional. - Once a network object is created, the
reserve_ip and gateway 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"
})
}