/
infoblox_zone_auth Data Source

infoblox_zone_auth Data Source

Use the infoblox_zone_auth data source to retrieve the following information about an authoritative DNS zone from the corresponding object in NIOS:

Parameter

Description

Example

Parameter

Description

Example

fqdn

The name of the DNS zone. For a reverse zone, this is in CIDR format.
For other zones, this is in FQDN format. This value can be in unicode format.

demozone.com

For reverse mapping zone: 11.10.0.0/24

view

The name of the DNS view in which the zone resides.

external

zone_format

Determines the format of the zone. Valid values are FORWARD, IPV4 and IPV6.

FORWARD

ns_group

The name server group that serves DNS for this zone.

demoGroup

comment

A description of the DNS zone. This is a regular comment.

The Auth zone object in NIOS.

ext_attrs

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

{\"Location\":\"unknown\",\"TestEA\":\"ZoneTesting\"}

To retrieve information about authoritative zones 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 authoritative zones in the NIOS Grid.

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

Parameter

Description

Parameter

Description

view

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

fqdn

Specifies the name of the DNS zone.

zone_format

Specifies the format of the DNS zone.

comment

The description of the DNS zone.

Extensible Attributes

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

Example of the Zone Auth Data Source Block

resource "infoblox_zone_auth" "zone1"{
fqdn = "17.1.0.0/16"
zone_format = "IPV4"
view = "default"
comment = "test sample reverse zone"
ext_attrs = jsonencode({
Location = "Test Zone Location"
})
}

data "infoblox_zone_auth" "dzone1" {
filters = {
view = "default"
fqdn = "test3.com"
zone_format = "FORWARD"
}

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

output "zauth_res" {
value = data.infoblox_zone_auth.dzone1
}

// accessing individual field in results
output "zauth_name" {
value = data.infoblox_zone_auth.dzone1.results.0.fqdn //zero represents index of json object from results list
}

// accessing Zone Auth by specifying EAs
data "infoblox_zone_auth" "zauth_ea" {
filters = {
"*Location" = "California"
      "*Location!" = "Florida"
}
}

// returns matching Zones with EA, if any
output "zauth_out" {
value = data.infoblox_zone_auth.zauth_ea
}

Related content