Use the data source to retrieve the following information for a host record, which is managed by a NIOS server:
Parameter | Description | Example |
---|---|---|
| The DNS view in which the record's zone exists. |
|
| The fully qualified domain name of the host record to which the IP address is assigned. |
|
| The IPv4 address allocated to the host record. |
|
| The IPv6 address allocated to the host record. |
|
| The MAC address assigned to the IPv4 address of the host record created using the |
|
| The zone that contains the record in the specified DNS view. |
|
| The Time to Live value of the record, in seconds. |
|
| It specifies the DHCPv6 Unique Identifier (DUID) of the IPv6 address object. |
|
| Specifies whether the host record was created in the DHCP server side. |
|
| Specifies whether DNS records associated with the resource was created. |
|
| A description of the record. This is a regular comment. |
|
| The set of extensible attributes of the record, if any. The content is formatted as a string of JSON map. |
|
To retrieve information about host records 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 host records in the NIOS Grid.
The following table describes the parameters you can define in an infoblox_host_record
data source block:
Parameter | Alias* | Description |
---|---|---|
|
| Specifies the fully qualified domain name to which the IP address is assigned. |
| - | Specifies the network view in which the record's zone exists. |
|
| Specifies the DNS view in which the record's zone exists. |
|
| Specifies the zone that contains the record. |
|
| Describes the record. |
Extensible Attributes | - | Specifies the extensible attributes specified for the record. You must specify the key/value pair within the |
*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.
Example of the Host Record Data Source Block
resource "infoblox_zone_auth" "zone1" {
fqdn = "example.org "
view = "default"
}
resource "infoblox_ip_allocation" "allocation1" {
dns_view = "default"
enable_dns = true
fqdn = "host1.example.org"
ipv4_addr = "10.10.0.7"
ipv6_addr = "1::1"
ext_attrs = jsonencode({"Location" = "USA"})
depends_on = [infoblox_zone_auth.zone1]
}
resource "infoblox_ip_association" "association1" {
internal_id = infoblox_ip_allocation.allocation1.id
mac_addr = "12:00:43:fe:9a:8c"
duid = "12:00:43:fe:9a:81"
enable_dhcp = false
depends_on = [infoblox_ip_allocation.allocation1]
}
data "infoblox_host_record" "host_rec_temp" {
filters = {
name = "host1.example.org"
}
}
output "host_rec_res" {
value = data.infoblox_host_record.host_rec_temp
}
// fetching Host-Records through EAs
data "infoblox_host_record" "host_rec_ea" {
filters = {
"*Location" = "USA"
}
}
output "host_ea_out" {
value = data.infoblox_host_record.host_rec_ea
}