Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use the data source to retrieve the following information for an A record, which is managed by a NIOS server:

...

To get information about an A record, specify a combination of , the DNS view, IPv4 address that the record points to , and the FQDN that corresponds to the IP address.

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

Parameter

Required/Optional

Description

dns_view

Required

Optional

Specifies the DNS view in which the record's zone exists.
If a value is not specified, default will be used as the DNS view name.
If the zone is in a non-default DNS view, then you must specify that view.

ip_addr

Required

Specifies the IPv4 address associated with the A record.

fqdn

Required

Specifies the fully qualified domain name to which the IP address is assigned.

Example of the A Record Data Source Block

The following example defines a data source of type infoblox_a_record and the name "vip_host", which is configured in a Terraform file. You can reference this resource and retrieve information about it. For example, data.infoblox_a_record.vip_host.comment returns the text entered as a comment for the A record.

data resource "infoblox_a_record" "vip_host" {
    fqdn = "very-interesting-host.example.com"
    ip_addr = "10.3.1.65"
    comment = "special host"
    dns_view = "default" this is a required parameternondefault_dnsview2"
    ttl = 120 // 120s
    ext_attrs = jsonencode({
      "Location" = "65.8665701230204, -37.00791763398113"
    })
}

data "infoblox_a_record" "vip_host" {
    dns_view="nondefault_dnsview2"
    fqdn="very-interesting-host.example.com"
    ip_addr="10.3.1.65"
   
    // This is just to ensure that the record has been be created

    // using 'infoblox_a_record' resource block before the data source will be queried.
    depends_on = [infoblox_a_record.vip_host]
}

output "vip_host_id" {
    value = data.infoblox_a_record.vip_host.id
}

...