Use the infoblox_ptr_record data source to retrieve the following information about a PTR record from the corresponding object in NIOS:
Parameter | Description | Example |
---|---|---|
| The DNS view which the record's zone belongs to. |
|
| the IPv4 or IPv6 address associated with the PTR-record. |
|
| The name of the PTR-record in FQDN format, which can be used instead of an IP address. |
|
| The fully qualified domain name that the PTR-record points to. |
|
| The zone in which the record exists. |
|
| The Time to Live value of the record, in seconds. |
|
| 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 PTR 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 PTR records in the NIOS Grid.
The following table describes the parameters you can define in an infoblox_ptr_record
data source block:
Parameter | Alias* | Description |
---|---|---|
|
| Specifies the fully qualified domain name the PTR record points to. |
|
| Specifies the name of the PTR record, in the FQDN format, that can be used instead of an IP address. Example: |
|
| Specifies the DNS view in which the record’s zone exists. |
|
| Specifies the IPv4 address associated with the PTR record. If both |
|
| Specifies the IPv6 address associated with the PTR record. If both |
|
| 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 PTR Record Data Source Block
The following example of an infoblox_ptr_record
data source block defines a data source of type infoblox_ptr_record
and name host1
, which is configured in a Terraform configuration file. You can reference this resource and retrieve information about it.
resource "infoblox_ptr_record" "host1" {
ptrdname = "host.example.org"
ip_addr = "2a05:d014:275:cb00:ec0d:12e2:df27:aa60"
comment = "workstation #3"
ttl = 300 # 5 minutes
ext_attrs = jsonencode({
"Location" = "the main office"
})
}
data "infoblox_ptr_record" "host1" {
filters = {
ptrdname="host.example.org"
ip_addr="2a05:d014:275:cb00:ec0d:12e2:df27:aa60"
}
// This is just to ensure that the record has been be created
// using 'infoblox_ptr_record' resource block before the data source will be queried.
depends_on = [infoblox_ptr_record.host1]
}
output "ptr_rec_res" {
value = data.infoblox_ptr_record.host1
}
data "infoblox_ptr_record" "host2" {
filters = {
dns_view="default"
ptrdname="host.example.org"
record_name="0.6.a.a.7.2.f.d.2.e.2.1.d.0.c.e.0.0.b.c.5.7.2.0.4.1.0.d.5.0.a.2.ip6.arpa"
}
}
output "ptr_host_res" {
value = data.infoblox_ptr_record.host2
}
// accessing individual field in results
output "ptr_rec_name" {
value = data.infoblox_ptr_record.host2.results.0.ptrdname //zero represents index of json object from results list
}
// accessing PTR-Record through EAs
data "infoblox_ptr_record" "ptr_rec_ea" {
filters = {
"*Owner" = "State Library"
"*Owner!" = "State Block"
}
}
// throws PTR-Records with EA, if any
output "ptr_rec_out" {
value = data.infoblox_ptr_record.ptr_rec_ea
}