terraform-provider-oci icon indicating copy to clipboard operation
terraform-provider-oci copied to clipboard

oci_dns_rrset documentation is incomprehensible

Open ITD27M01 opened this issue 3 years ago • 2 comments

Hi Guys,

Can you explain please in more details the fields of oci_dns_rrset resource. What is "items" in such resource and how the fields inside "items" are connected with other top level required fields?

https://docs.oracle.com/en-us/iaas/tools/terraform-provider-oci/4.18.0/docs/r/dns_rrset.html

ITD27M01 avatar Mar 25 '21 09:03 ITD27M01

You may find the underlying API documentation helpful where the Terraform documents do not fully explain a topic. For example, see here for details on the items attribute:

https://docs.oracle.com/en-us/iaas/api/#/en/dns/20180115/datatypes/UpdateRRSetDetails

More specifically, consider that a DNS record may have more than one result. For example, Oracle Database SCAN addresses or this example from www.google.com which has these addresses you'd find by using nslookup, dig, or otherwise similar tools to query DNS:

172.253.122.99
172.253.122.105
172.253.122.106

. . . 

Therefore, to create this record in OCI DNS (Google uses OCI as their backend, right?) you'd have a resource such as this:

resource "oci_dns_rrset" "the_rrset" {
  domain = "www.google.com"
  rtype = "A"
  zone_name_or_id = var.zone_name_or_id
  compartment_id = var.compartment_id

  items {
    domain = "www.google.com"
    rdata = "172.253.122.99"
    rtype = "A"
    ttl = 300
  }
  items {
    domain = "www.google.com"
    rdata = "172.253.122.105"
    rtype = "A"
    ttl = 300
  }
  items {
    domain = "www.google.com"
    rdata = " 172.253.122.106"
    rtype = "A"
    ttl = 300
  }
  scope = var.scope
  view_id = var.view_id
}

Admittedly, I don't understand the point of redundant domain and rtype attributes at the resource root as well as in each items block but perhaps there is a use case I haven't yet encountered that would require these to vary. In any case, for most (if not all) use cases you're likely to have the same domain and rtype for all occurrences within the resource.

jeliker avatar Jul 16 '21 19:07 jeliker

I found this page as a result of Googling oci_dns_rrset example.

It's shocking how lacking the OCI Terraform docs are, as every single example on every page uses values that are of the form var.value instead of actually providing concrete examples that would be useful.

The descriptions for every field are just as useless.

Oracle really needs to document better than this.

et304383 avatar Apr 13 '22 18:04 et304383

I've spent the last two hours trying to figure out how to make a simple A record. How about some real examples with real data instead of the useless var.value that's on there now?

bschonec avatar Nov 09 '22 13:11 bschonec