infoblox_txt_record Data Source
Use the data source to retrieve the following information for a TXT 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 to which a textual value is assigned. |
|
| The textual value for the TXT record. |
|
| 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 string of JSON map. |
|
To retrieve information about TXT 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 TXT records in the NIOS Grid.
The following table describes the parameters you can define in an infoblox_txt_record
data source block:
Parameter | Alias* | Description |
---|---|---|
|
| Specifies the fully qualified domain name to which the textual value is assigned. |
|
| Specifies the textual value for the TXT record. |
|
| 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 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" {
filters = {
view = "nondefault_dnsview1"
name = "example3.example2.org"
text = "\"data for TXT-record #3\""
}
// This is just to ensure that the record has been created
// using 'infoblox_txt_record' resource block before the data source will be queried.
depends_on = [infoblox_txt_record.rec3]
}
output "txt_rec_res" {
value = data.infoblox_txt_record.ds3
}
// accessing individual field in results
output "txt_rec_mes" {
value = data.infoblox_txt_record.ds3.results.0.text //zero represents index of json object from results list
}
// Searching for TXT-Record by specifying EAs
data "infoblox_txt_record" "txt_rec_ea" {
filters = {
"*Location" = "65.8665701230204, -37.00791763398113"
"*Location!" = "75.8665701230211"
}
}
// throws matching TXT-Records with EA, if any
output "txt_rec_out" {
value = data.infoblox_txt_record.txt_rec_ea
}