terraform-provider-oci
terraform-provider-oci copied to clipboard
oci_dns_rrset documentation is incomprehensible
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
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.
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.
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?