---
title: "Terraform Configuration File for IPv4 Network"
canonical: "https://docs.infoblox.com/space/DeploymentGuideTerraformNIOSProvider/807896711/Terraform%20Configuration%20File%20for%20IPv4%20Network"
format: markdown
---
A Terraform configuration file is a document written in the Terraform configuration language, which describes a number of resources to be managed by Terraform.

1. Create a folder named **network** and save **ipv4_network.tf **file in the folder.
2. Double click the **ipv4_network.tf** file to open in VScode or any other code editor
3. ** **We will examine each block in the file.

a. The **terraform** block is used to specify the required provider and version, which is the Infoblox provider in this case.

![image](media://beda3a0b-17b6-4a7f-92ce-a6effaac41d0)

 

 b. A **provider** block is used to specify options for the provider. In this block, we provide the Grid Master IP and user credentials.

 *Note: These options can also be set using environmental variables instead of using a provider block to avoid saving credentials in the file. *<u>[read more ](https://docs.infoblox.com/space/ipamdriverterraform/53121314/Configuring+Infoblox+IPAM+Plug-In+Version+2.5.0+for+Terraform)</u> 

![image](media://9b1faaf9-d684-45a8-8f8f-61fefa08d223)

c. The first **resource** block specifies the resource to be created is an **infoblox_ipv4_network**. The name, **net1/net2 **, will be used by Terraform to identify this specific instance of this resource. 

d. The **cidr** argument is used to manually assign the desired CIDR. 

e.The **reserve_ip** argument will reserve IPs at the beginning of the range; this is useful with cloud providers such as Azure where the first 3 IPs in a subnet are reserved for features of the cloud provider and not available for assignment.

f. The **comment** argument defines a comment added to the resource in the Grid. This argument can be used with any of the Infoblox provider resources.

g. Extensible attributes are specified in the **ext_attrs** argument, in a JSON encoded block. This argument can be used with any of the Infoblox provider resources.

h. Anything after a **# or // ** on a line is a comment and not read by Terraform.

![image](media://97f5a9e7-4b57-4180-b631-fc2aba021217)

i. The second resource block specifies another **infoblox_ipv4_network**, with a unique name, **dynamic_ipv4**.

j. The **parent_cidr** argument is used instead of cidr to specify a network container where this network should be created, using the next available network function.

k. The **allocate_prefix_len** argument specifies the size of the network to create, in this case a **/24**.

![image](media://a92d5fe9-d1fd-441e-93f2-c6107fee542d)

4. Your configuration file is ready for deployment