Use the data source to retrieve the following information for a TXT record, which is managed by a NIOS server:
Parameter | Description | Example |
---|---|---|
| The textual value for the TXT record. You must specify a value for this parameter. |
|
| The zone that contains the record. |
|
| 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 JSON map. |
|
To get information about a TXT record, specify the FQDN of the domain to which the text record is assigned, the FQDN of the mail exchange host, and the preference number.
The following table describes the parameters you can define in an infoblox_txt_record
data source block:
Parameter | Required/Optional | Description |
---|---|---|
| Required | Specifies the fully qualified domain name to which the textual value is assigned. |
| Optional | Specifies the DNS view in which the record’s zone exists. |
Example of the TXT Record Data Source Block
The following example defines a data source of type infoblox_txt_record
and the name "ds3
", which is configured in a Terraform file. You can reference this data source and retrieve information about it.
resource "infoblox_txt_record" "rec3" {
dns_view = "nondefault_dnsview1"
fqdn = "example3.example2.org"
text = "data for TXT-record #3"
ttl = 300
comment = "example TXT record #3"
ext_attrs = jsonencode({
"Location" = "65.8665701230204, -37.00791763398113"
})
}
data "infoblox_txt_record" "ds3" {
dns_view = "nondefault_dnsview1"
fqdn = "example3.example2.org"
// This is just to ensure that the record has been be created
// using 'infoblox_txt_record' resource block before the data source will be queried.
depends_on = [infoblox_txt_record.rec3]
}
output "txt_rec3_text" {
value = data.infoblox_txt_record.ds3.text
}
output "txt_rec3_zone" {
value = data.infoblox_txt_record.ds3.zone
}
output "txt_rec3_ttl" {
value = data.infoblox_txt_record.ds3.ttl
}
output "txt_rec3_comment" {
value = data.infoblox_txt_record.ds3.comment
}
output "txt_rec3_ext_attrs" {
value = data.infoblox_txt_record.ds3.ext_attrs
}