---
title: "infoblox_ipv4_range_template Data Source"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/1383137606/infoblox_ipv4_range_template%20Data%20Source"
format: markdown
---
The data source for the IPv4 range template object allows you to get the following parameters for an IPv4 range template resource:

| **Parameter** | **Description** | **Example** |
| --- | --- | --- |
| `name` | The name of the range template record. | `range-template1` |
| `number_of_addresses` | The number of addresses for this range. | `100` |
| `offset` | The start address offset for the range. | `30` |
| `use_options` | This flag indicates whether the `options` field is enabled. | `true` |
| `cloud_api_compatible` | This flag indicates whether this template is used to create network objects in a cloud-computing deployment. | `true` |
| `options` | An array of DHCP option structs that lists the DHCP options associated with the object. | `{`  
`  name = "domain-name-servers"`  
`  value = "10.22.33.46"`  
`  vendor_class = "DHCP"`  
`  num = 6`  
`  use_option = false`  
`}` |
| `server_association_type` | The type of server that serves the range template. | `NONE` |
| `failover_association` | The name of the failover association. The server in this failover association serves the IPv4 range template when the main server is out of service. | `dhcp_failover` |
| `member` | The member that provides service for this range template. This value is returned when `server_association_type` is set to `MEMBER`. | `{`  
`  ipv4addr = "10.197.81.146"`  
`  ipv6addr = 2403:8600:80cf:e10c:3a00::1192"`  
`  name = "infoblox.localdomain"`  
`}` |
| `ms_server` | The IP address of the Microsoft server that will provide service to this range template. | `198.51.100.0` |
| `comment` | A description of the IPv4 range template. This is a regular comment. | `Untrusted network` |
| `ext_attrs` | The set of extensible attributes, if any. The content is formatted as a string of JSON map. | `{\"Owner\":\"State Library\",\"Administrator\":\"unknown\"}` |

To retrieve information about IPv4 range template objects that match the specified filters, use the `filters` argument and specify the parameters mentioned in the below table. These are the searchable parameters of the corresponding object in Infoblox NIOS WAPI. If you do not specify any parameter, the data source retrieves information about all IPv4 range templates in the NIOS Grid.

The following table describes the parameters you can define in an `infoblox_ipv4_range_template` data source block:

| **Parameter** | **Alias*** | **Description** |
| --- | --- | --- |
| `name` | `name` | Specifies the name of the range template record. |
| `failover_association` | `failover_association` | Specifies the name of the failover association. |
| `server_association_type` | `server_association_type` | Specifies the type of server that serves the range. |
| `comment` | `comment` | Describes the range template. |
| Extensible Attributes | - | Specifies the extensible attributes specified for the range template. You must specify the key/value pair within the `filters` argument.  
Example:  
`filters = {`  
`"*Site" = "some test site"`  
`}` |

*Aliases are the parameter names used in the prior releases of Infoblox IPAM Plug-In for Terraform. Do not use the alias names for parameters in the data source blocks. Using them can result in error scenarios.

> ⚠️ **Note**
> ⚠️ 
> ⚠️ The search functionality using the `filters` argument is not supported for `member` and `ms_server` fields.

## Example of an IPv4 Range Template Data Source Block

`resource "infoblox_ipv4_range_template" "range_template1" {`  
`  name = "range-template3"`  
`  number_of_addresses = 60`  
`  offset = 76`  
`  comment = "Temporary Range Template"`  
`  cloud_api_compatible = false`  
`  use_options = true`  
`  ext_attrs = jsonencode({`  
`    "Site" = "Kobe"`  
`  })`  
`  options {`  
`    name = "domain-name-servers"`  
`    value = "10.22.23.24"`  
`    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"`  
`}`

  
`data "infoblox_ipv4_range_template" "range_template_read" {`  
`  filters = {`  
`    failover_association = "failover1"`  
`  }`

`  // This is just to ensure that the range template has been be created`  
`  // using 'infoblox_ipv4_range_template' resource block before the data source will be queried.`  
`  depends_on = [infoblox_ipv4_range_template.range_template1]`  
`}`

`output "range_template_res" {`  
`  value = data.infoblox_ipv4_range_template.range_template_read`  
`}`