Use the data resource for the CNAME object to retrieve the following information for CNAME records:
...
resource "infoblox_cname_record" "foo" {
dns_view = "default.nondefault_netview"
canonical = "strange-place.somewhere.in.the.net"
alias = "foo.test.com"
comment = "we need to keep an eye on this strange host"
ttl = 0 // disable caching
ext_attrs = jsonencode({
Site = "unknown"
Location = "TBD"
})
}
data "infoblox_cname_record" "foo"{ dns_view="default.nondefault_netview"
alias="foo.test.com"
canonical="main.test.com"
// This is just to ensure that the record has been be created
// using 'infoblox_cname_record' resource block before the data source will be queried.
depends_on = [infoblox_cname_record.foo]}
...