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 SRV record, which is managed by a NIOS server:

Parameter

Description

Example

dns_view

The DNS view in which the record's zone exists.

10

name

The record's name in the format, defined in the RFC2782 document.

http._tcp.acme.com

target

An FQDN of the host that is responsible for providing the service specified by name.

www.acme.com

port

A port number (0-65535) on the target host on which the service expects the requests.

6000

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 string of JSON map.

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

To get retrieve information about an SRV record, specify a combination of, the record name, FQDN of the host providing the service, and port number on the hostSRV 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 SRV records in the NIOS Grid.

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

Parameter

Required/Optional

Alias*

Description

name

RequiredSpecifies the fully qualified domain name of the host that provides the service

fqdn

Specifies the record's name.

target

Required

priority

priority

Specifies the priority number as described in the RFC2782 document.

view

dns_view

Specifies the DNS view in which the record’s zone exists.
If a value is not specified, matching objects are retrieved from all DNS views in the NIOS Grid.

weight

weight

Specifies the weight number as described in the RFC2782 document.

port

Required

port

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

dns_view

target

Optional

target

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

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

zone

zone

Specifies the zone that contains the record.

comment

comment

Describes the record.

Extensible Attributes

-

Specifies the extensible attributes specified for the record. You must specify the key/value pair within the filters argument.
Example:
filters = {
"*Site" = "some test site"
}

*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 SRV Record Data Source Block

...

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_ filters = {
view = "nondefault_dnsview1"
name = "_sip._udp.example2.org"
port = 5060
target = "sip.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_rec2rec_priorityres" {
value = data.infoblox_srv_record.ds1.priority
}

// accessing individual fields in results
output "srv_rec2rec_weightname" {
value = data.infoblox_srv_record.ds1.weight
}
output "srv_rec2_zone" {
value = data..results.0.name //zero represents index of json object from results list
}

// accessing SRV-Record through EA's
data "infoblox_srv_record.ds1.zone
}
output " "srv_rec2rec_ttlea" {
value = data.infoblox_srv_record.ds1.ttl
}
output "srv_rec2_comment" {
value = data.infoblox_srv_record.ds1.comment
} filters = {
"*Owner" = "State Library"
"*Owner!" = "State Block"
"*Expires" = "never"
}
}

// throws matching SRV-Records with EA, if any
output "srv_rec2rec_ext_attrsout" {
value = data.infoblox_srv_record.ds1.ext_attrssrv_rec_ea
}