---
title: "infoblox_ipv4_range_template Resource"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/1383268662/infoblox_ipv4_range_template%20Resource"
format: markdown
---
This resource enables you to perform create, update, and delete operations on IPv4 range template objects. An IPv4 range template can be used to create DHCP ranges. The DHCP ranges generated from this template will inherit the properties defined within the range template.

The following table describes the parameters you can define in a range template resource block:

| **Parameter** | **Required/**  
**Optional** | **Description** |
| --- | --- | --- |
| `name` | Required | Specifies the display name of the range template. |
| `number_of_addresses` | Required | Specifies the number of addresses for this range. |
| `offset` | Required | Specifies the start address offset for the range. |
| `use_options` | Optional | Determines whether the `options` field is enabled. The default value is `false`.  
To use `options`, you must set this parameter to `true`. |
| `options` | Optional | Specifies an array of DHCP option structs that lists the DHCP options associated with the object. You can set the following sub parameters for every DHCP option that you define:<br>- `name` (required): Specifies the name of a DHCP option.  
Example: `domain-name-servers`.
- `value` (required): Specifies the value of the option you are defining.
- `num` (required): Specifies the code of the DHCP option.
- `use_option`: Determines whether the custom DHCP option that you choose from the below list must be enabled. The default value is `false`.  
These options correspond to those listed in the **Custom DHCP Options** drop-down list in NIOS Grid Manager: `router`, `router-templates`, `domain-name-servers`, `domain-name`, `broadcast-address`, `broadcast-address-offset`, `dhcp-lease-time`, and `dhcp6.name-servers`. |
| `server_association_type` | Optional | Specifies the type of server that will serve the range. Valid values are: `FAILOVER`, `MEMBER`, `MS_FAILOVER`, `MS_SERVER`, or `NONE`. |
| `failover_association` | Optional | Specifies the name of the failover association. The server in this failover association will serve the IPv4 range in case the main server is out of service. |
| `member` | Optional | Specifies the member that will provide service for this range.   
If you want the server specified here to serve the range, you must set `server_association_type` to `MEMBER`.<br>You can define the following sub parameters:<br>- `name` (required): Specifies the name of the pool.
- `ipv4addr` (required): Specifies the IPv4 address of the Grid member
- `ipv6addr`: Specifies the IPv6 address of the member. |
| `cloud_api_compatible` | Optional | Determines whether this template can be used to create network objects in a cloud-computing deployment.  
The default value is `false`.<br>If the *[Terraform internal ID extensible attribute](https://infoblox-docs.atlassian.net/wiki/spaces/ipamdriverterraform/pages/593692260)* is set up for cloud API access, then you must set this parameter to `true`. |
| `ms_server` | Optional | Specifies the IP address of the Microsoft server that will provide service to this range template. If you want the server specified here to serve the range template, set `server_association_type` to `MS_SERVER`. |
| `comment` | Optional | Describes the IPv4 range template. |
| `ext_attrs` | Optional | Specifies the set of NIOS extensible attributes that will be attached to the IPv4 range template object. |

> ⚠️ **Note**
> ⚠️ 
> ⚠️ When configuring the `options` parameter, you must define the default option `dhcp-lease-time` to avoid the undesirable changes that can occur when the next `terraform apply` command runs. The sub parameters `name`, `num`, and `value` are required. An example block is as follows:  
> ⚠️ `options {`  
> ⚠️ `    name = "dhcp-lease-time"`  
> ⚠️ `    num = 51`  
> ⚠️ `    value = "43200"`  
> ⚠️ `    use_option = false`  
> ⚠️ `}`

## Examples of the IPv4 Range Template Resource Block

`// creating a Range Template record with minimal set of parameters`  
`resource "infoblox_ipv4_range_template" "range_template_minimal_parameters" {`  
`  name = "range-template1"`  
`  number_of_addresses = 10`  
`  offset = 20`  
`}`  
  
`// creating a Range Template record with full set of parameters`  
`resource "infoblox_ipv4_range_template" "range_template_full_set_parameters" {`  
`  name = "range-template2"`  
`  number_of_addresses = 40`  
`  offset = 30`  
`  comment = "Temporary Range Template"`  
`  cloud_api_compatible = true`  
`  use_options = true`  
`  ext_attrs = jsonencode({`  
`    "Site" = "Kobe"`  
`  })`  
`  options {`  
`    name = "domain-name-servers"`  
`    value = "10.22.33.44"`  
`    vendor_class = "DHCP"`  
`    num = 6`  
`    use_option = true`  
`  }`  
`  member = {`  
`    ipv4addr = "10.197.81.146"`  
`    ipv6addr = "2001:DB8:0:0:0:0:0:0"`  
`    name = "infoblox.localdomain"`  
`  }`  
`  failover_association = "failover1"`  
`  server_association_type = "FAILOVER"`  
`}`