---
title: "infoblox_ipv4_network_container Resource"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/53121492/infoblox_ipv4_network_container%20Resource"
format: markdown
---
> Macro (excerpt)
> 
> <span style="color: #000000">This network container resource, enables you to create, update, or delete a network container in a NIOS appliance.</span>
> 
> <span style="color: #000000">The following table describes the parameters you can define in the network container resource block:</span>
> 
> | <span style="color: #000000">**Parameter**</span> | <span style="color: #000000">**Required/**</span>  
> <span style="color: #000000">**Optional**</span> | <span style="color: #000000">**Description**</span> |
> | --- | --- | --- |
> | `network_view` | Optional | <span style="color: #000000">Specifies the network view in which to create the network container.</span>  
> If a value is not specified, `default` will be used as the network view name. |
> | `cidr` | <span style="color: #000000">Required only if </span>`parent_cidr`<span style="color: #000000"> is not set</span> | <span style="color: #000000">Specifies the network block to use for the network container.</span>  
> <span style="color: #000000">Do not use an IPv4 CIDR for an IPv6 network and an IPv6 CIDR for an IPv4 network.</span> |
> | `parent_cidr` | Required only if `cidr` is not set | Specifies the network container from which the next available network container 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` or `filter_params` is set | Defines the length of the network part of the address for a network container that should be allocated from a parent network container, which in turn is determined by `parent_cidr`or `filter_params`. |
> | `filter_params` | Optional | Specifies the extensible attributes of the parent network container that must be used as filters to retrieve the next available network for creating the network container object. |
> | `comment` | <span style="color: #000000">Optional</span> | <span style="color: #000000">Describes the network container.</span> |
> | `ext_attrs` | <span style="color: #000000">Optional</span> | <span style="color: #000000">Specifies the set of NIOS extensible attributes that will be attached to the network container.</span> |
> 
> > ⚠️ **Note**
> > ⚠️ 
> > ⚠️ - Either `cidr,` the combination of `parent_cidr` and `allocate_prefix_len`, or the combination of `filter_params` and `allocate_prefix_len` is required. The rest of the parameters are optional.
> > ⚠️ - <span style="color: #000000">Once the network container is created, the </span>`network_view`<span style="color: #000000">, </span>`cidr`<span style="color: #000000">, </span>`parent_cidr`<span style="color: #000000">,  </span>`allocate_prefix_len`, and `filter_params`<span style="color: #000000"> parameter values cannot be changed by performing an update operation.</span>

## <span style="color: #000000">Examples of the Network Container Resource</span>

`// statically allocated IPv4 network container, minimal set of parameters`  
`resource "infoblox_ipv4_network_container" "v4net_c1" {`  
`    cidr = 10.2.0.0/24`  
`}`  


`// full set of parameters for statically allocated IPv4 netork container`  
`resource "infoblox_ipv4_network_container" "v4net_c2" {`  
`    cidr = 10.2.0.0/24 // you may allocate the same IP address range but in another network view`  
`    network_view = "nondefault_netview"`  
`    comment = "one of our clients"`  
`    ext_attrs = jsonencode({`  
`      "Site" = "remote office"`  
`      "Country" = "Australia"`  
`    })`  
`}`  


`// Full set of parameters for dynamic allocation of network containers`  
`resource "infoblox_ipv4_network_container" "v4net_c3" {`  
`    parent_cidr = infoblox_ipv4_network_container.v4net_c2.cidr`  
`    allocate_prefix_len = 26`  
`    network_view = "infoblox_ipv4_network_container.v4net_c2.network_view"`  
`    comment = "one of our clients"`  
`    ext_attrs = jsonencode({`  
`      "Site" = "remote office"`  
`      "Country" = "Australia"`  
`    })`  
`}`  


`//create network container resource using next-available-network based on extensible attributes tag`  
`resource "infoblox_ipv4_network_container" "nc7" {`  
`    allocate_prefix_len = 26`  
`    # network_view = "nondefault_netview"`  
`    comment = "network container created with the next available network"`  
`    filter_params = jsonencode({`  
`      "*Site": "Blr"`  
`    })`  
`}`