Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Next »

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

Parameter

Description

Example

priority

The priority number as described in the RFC2782 document.

10

weight

The weight number as described in the RFC2782 document.

6

zone

The zone that contains the record.

test.com

ttl

The Time to Live value of the record, in seconds.

3600

comment

A description of the record. This is a regular comment.

spare node for the service

ext_attrs

The set of extensible attributes of the record, if any. The content is formatted as a JSON map.

{"Owner": "State Library", "Expires": "never"}

To get information about an SRV record, specify a combination of, the record name, FQDN of the host providing the service, and port number on the host.

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

Parameter

Required/Optional

Description

name

Required

Specifies the record's name.

target

Required

Specifies the fully qualified domain name of the host that provides the service.

port

Required

Specifies a port number on the host that is defined by the target parameter.

dns_view

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.

Example of the SRV Record Data Source Block

The following example defines a data source of type infoblox_srv_record and the name "ds1", which is configured in a Terraform file. You can reference this data source and retrieve information about it.

resource "infoblox_srv_record" "rec2" {
dns_view = "nondefault_dnsview1"
name = "_sip._udp.example2.org"
priority = 12
weight = 10
port = 5060
target = "example2.org "
ttl = 3600
comment = "example SRV record"
ext_attrs = jsonencode({
"Location" = "65.8665701230204, -37.00791763398113"
})
}

data "infoblox_srv_record" "ds1" {
dns_view = "nondefault_dnsview1"
name = "_sip._udp.example2.org"
port = 5060
target = "example2.org "

// This is just to ensure that the record has been be created
// using 'infoblox_srv_record' resource block before the data source will be queried.
depends_on = [infoblox_srv_record.rec2]
}

output "srv_rec2_priority" {
value = data.infoblox_srv_record.ds1.priority
}
output "srv_rec2_weight" {
value = data.infoblox_srv_record.ds1.weight
}
output "srv_rec2_zone" {
value = data.infoblox_srv_record.ds1.zone
}
output "srv_rec2_ttl" {
value = data.infoblox_srv_record.ds1.ttl
}
output "srv_rec2_comment" {
value = data.infoblox_srv_record.ds1.comment
}
output "srv_rec2_ext_attrs" {
value = data.infoblox_srv_record.ds1.ext_attrs
}

  • No labels