Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 when you use 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_viewOptional

Specifies the network view in which to create the network.
The default If a value is  defaultnot specified, the name default is considered as the network view.

cidrRequired 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 an IPv6 network and vice versaIPv6 CIDR for an IPv4 network.
If you configure both cidr and parent_cidr, the value of parent_cidr will be ignored.

parent_cidrRequired 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_lenRequired only if parent_cidr is set

It defines 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.

gatewayOptional

It defines Defines the IP address of the gateway within the network block.

  • If a value is not set, the first IP address of the allocated network will be assigned.
  • If the value is set to none, no value will be assigned.

For more information, see Limitations.

commentOptionalDescribes the network.
ext_attrsOptionalSpecifies the set of NIOS extensible attributes that will be attached to the network.


...

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
titleNote
  • 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

// statically allocated IPv4 network. Example with minimal set of parameters
resource "infoblox_ipv4_network_container" "nc1net1" {
  network_view = "default"
  cidr = "    cidr = 10.0.0.0/16"
}

// A full set of parameters for a statically allocated network in a non-default network view.IPv4 network
resource "infoblox_ipv4_network" "nw1net2" {
  network_view = "very_special_network_view"
  cidr = "10.0    cidr = 10.1.0.0/24
    network_view = "nondefault_netview"
  reserve    reserve_ip = 5
  gateway     gateway = "10.01.0.6254"
  comment     comment = "mockup small network for testing"
    ext_attrs = jsonencode({
    "Tenant ID" = "tf-plugin"
    "Cloud API Owned" = "True"
    "CMP Type"= "VMware"
    "Site" = "Nevada"

 
  })
}


//full set of parameters for a dynamically allocated IPv4 network
resource "infoblox_ipv4_network" "nw2net3" {
  // The 'network_view' attribute is omitted,
  // thus is implied to be 'default'
  parent    parent_cidr =  infobloxinfoblox_ipv4_network_container.nc1v4net_c1.cidr
  allocate// reference to the resource from another example

    allocate_prefix_len = 30
  ext_attrs = jsonencode({
    "Tenant ID" = "tf-plugin"
    "Cloud API Owned" = "True"
    "CMP Type"= "VMware"26 # 24 (existing network container) + 2 (new network), prefix

    network_view = "default" # optional parameter
    reserve_ip = 2
    gateway = "none" # no gateway defined for this network
    comment = "even smaller network for testing"
    ext_attrs = jsonencode({
      "Custom EA 1Site" = "category 14Nevada"
      })
}