diff --git a/docs/data-sources/a_record.md b/docs/data-sources/a_record.md index f046b90..265a4e0 100644 --- a/docs/data-sources/a_record.md +++ b/docs/data-sources/a_record.md @@ -13,16 +13,12 @@ A record data source ## Example Usage ```terraform -data "octodns_a_record" "default_scope" { - zone = "example.com" +data "octodns_a_record" "root" { + zone = "unit.tests" name = "@" } - - -data "octodns_a_record" "custom_scope" { - zone = "example.com" - scope = "internal" - name = "www" +output "a_record" { + value = data.octodns_a_record.root } ``` diff --git a/docs/data-sources/aaaa_record.md b/docs/data-sources/aaaa_record.md index 50401ed..912db30 100644 --- a/docs/data-sources/aaaa_record.md +++ b/docs/data-sources/aaaa_record.md @@ -10,7 +10,17 @@ description: |- AAAA record data source - +## Example Usage + +```terraform +data "octodns_aaaa_record" "aaaa" { + zone = "unit.tests" + name = "aaaa" +} +output "aaaa_record" { + value = data.octodns_aaaa_record.aaaa +} +``` ## Schema diff --git a/docs/data-sources/caa_record.md b/docs/data-sources/caa_record.md index 8402fdf..9d3c4bf 100644 --- a/docs/data-sources/caa_record.md +++ b/docs/data-sources/caa_record.md @@ -10,7 +10,17 @@ description: |- CAA record data source - +## Example Usage + +```terraform +data "octodns_caa_record" "root" { + zone = "unit.tests" + name = "@" +} +output "caa_record" { + value = data.octodns_caa_record.root +} +``` ## Schema diff --git a/docs/data-sources/cname_record.md b/docs/data-sources/cname_record.md index bc2a26a..6ef995f 100644 --- a/docs/data-sources/cname_record.md +++ b/docs/data-sources/cname_record.md @@ -10,7 +10,17 @@ description: |- CNAME record data source - +## Example Usage + +```terraform +data "octodns_cname_record" "cname" { + zone = "unit.tests" + name = "cname" +} +output "cname_record" { + value = data.octodns_cname_record.cname +} +``` ## Schema diff --git a/docs/data-sources/dname_record.md b/docs/data-sources/dname_record.md index f918d0f..fa1e0fa 100644 --- a/docs/data-sources/dname_record.md +++ b/docs/data-sources/dname_record.md @@ -10,7 +10,17 @@ description: |- DNAME record data source - +## Example Usage + +```terraform +data "octodns_dname_record" "dname" { + zone = "unit.tests" + name = "dname" +} +output "dname_record" { + value = data.octodns_dname_record.dname +} +``` ## Schema diff --git a/docs/data-sources/loc_record.md b/docs/data-sources/loc_record.md index c2da8f7..0624974 100644 --- a/docs/data-sources/loc_record.md +++ b/docs/data-sources/loc_record.md @@ -10,7 +10,17 @@ description: |- LOC record data source - +## Example Usage + +```terraform +data "octodns_loc_record" "loc" { + zone = "unit.tests" + name = "loc" +} +output "loc_record" { + value = data.octodns_loc_record.loc +} +``` ## Schema diff --git a/docs/data-sources/mx_record.md b/docs/data-sources/mx_record.md index a66c1be..2ea6fc2 100644 --- a/docs/data-sources/mx_record.md +++ b/docs/data-sources/mx_record.md @@ -10,7 +10,17 @@ description: |- MX record data source - +## Example Usage + +```terraform +data "octodns_mx_record" "mx" { + zone = "unit.tests" + name = "mx" +} +output "mx_record" { + value = data.octodns_mx_record.mx +} +``` ## Schema diff --git a/docs/data-sources/naptr_record.md b/docs/data-sources/naptr_record.md index 2568a49..5c8704a 100644 --- a/docs/data-sources/naptr_record.md +++ b/docs/data-sources/naptr_record.md @@ -10,7 +10,17 @@ description: |- NAPTR record data source - +## Example Usage + +```terraform +data "octodns_naptr_record" "naptr" { + zone = "unit.tests" + name = "naptr" +} +output "naptr_record" { + value = data.octodns_naptr_record.naptr +} +``` ## Schema diff --git a/docs/data-sources/ns_record.md b/docs/data-sources/ns_record.md index ee238fd..a31d4a4 100644 --- a/docs/data-sources/ns_record.md +++ b/docs/data-sources/ns_record.md @@ -10,7 +10,17 @@ description: |- NS record data source - +## Example Usage + +```terraform +data "octodns_ns_record" "root" { + zone = "unit.tests" + name = "@" +} +output "ns_record" { + value = data.octodns_ns_record.root +} +``` ## Schema diff --git a/docs/data-sources/srv_record.md b/docs/data-sources/srv_record.md index a17c551..9e176b8 100644 --- a/docs/data-sources/srv_record.md +++ b/docs/data-sources/srv_record.md @@ -10,7 +10,17 @@ description: |- SRV record data source - +## Example Usage + +```terraform +data "octodns_srv_record" "root" { + zone = "unit.tests" + name = "_imap._tcp" +} +output "srv_record" { + value = data.octodns_srv_record.root +} +``` ## Schema diff --git a/docs/data-sources/sshfp_record.md b/docs/data-sources/sshfp_record.md index ca86685..d613b15 100644 --- a/docs/data-sources/sshfp_record.md +++ b/docs/data-sources/sshfp_record.md @@ -10,7 +10,17 @@ description: |- SSHFP record data source - +## Example Usage + +```terraform +data "octodns_sshfp_record" "root" { + zone = "unit.tests" + name = "@" +} +output "sshfp_record" { + value = data.octodns_sshfp_record.root +} +``` ## Schema diff --git a/docs/data-sources/txt_record.md b/docs/data-sources/txt_record.md index 0e199c1..51f1a56 100644 --- a/docs/data-sources/txt_record.md +++ b/docs/data-sources/txt_record.md @@ -10,7 +10,17 @@ description: |- TXT record data source - +## Example Usage + +```terraform +data "octodns_txt_record" "txt" { + zone = "unit.tests" + name = "txt" +} +output "txt_record" { + value = data.octodns_txt_record.txt +} +``` ## Schema diff --git a/docs/data-sources/urlfwd_record.md b/docs/data-sources/urlfwd_record.md index e256fbc..47e93aa 100644 --- a/docs/data-sources/urlfwd_record.md +++ b/docs/data-sources/urlfwd_record.md @@ -10,7 +10,17 @@ description: |- URLFWD record data source - +## Example Usage + +```terraform +data "octodns_urlfwd_record" "urlfwd" { + zone = "unit.tests" + name = "urlfwd" +} +output "urlfwd_record" { + value = data.octodns_urlfwd_record.urlfwd +} +``` ## Schema diff --git a/docs/resources/a_record.md b/docs/resources/a_record.md index c36ddad..deb5154 100644 --- a/docs/resources/a_record.md +++ b/docs/resources/a_record.md @@ -13,22 +13,11 @@ A record resource ## Example Usage ```terraform -resource "octodns_a_record" "localhost" { +resource "octodns_a_record" "root" { zone = "example.com" - name = "localhost" - ttl = 3600 - values = ["127.0.0.1"] - octodns = { - cloudflare = { - proxied = true - } - } -} - -resource "octodns_a_record" "minimal" { - zone = "example.com" - name = "www" - values = ["127.0.0.1"] + name = "@" + ttl = 300 + values = ["1.2.3.4", "5.6.7.8"] } ``` @@ -38,13 +27,13 @@ resource "octodns_a_record" "minimal" { ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/aaaa_record.md b/docs/resources/aaaa_record.md index 65826c3..b95cbc0 100644 --- a/docs/resources/aaaa_record.md +++ b/docs/resources/aaaa_record.md @@ -10,7 +10,15 @@ description: |- AAAA record resource +## Example Usage +```terraform +resource "octodns_aaaa_record" "aaaa" { + zone = "example.com" + name = "aaaa" + values = ["2601:644:500:e210:62f8:1dff:feb8:947a"] +} +``` ## Schema @@ -18,13 +26,13 @@ AAAA record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/caa_record.md b/docs/resources/caa_record.md index bb7fab2..b57b61f 100644 --- a/docs/resources/caa_record.md +++ b/docs/resources/caa_record.md @@ -10,7 +10,26 @@ description: |- CAA record resource +## Example Usage +```terraform +locals { + + caa_raw = [ + { flags = 30, tag = "issue", value = "ca.unit.tests" }, + ] + + caa_values = [for v in local.caa_raw : "${v.flags} ${v.tag} ${v.value}"] + +} + +resource "octodns_caa_record" "root" { + zone = "example.com" + name = "@" + ttl = 300 + values = local.caa_values +} +``` ## Schema @@ -18,13 +37,13 @@ CAA record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/cname_record.md b/docs/resources/cname_record.md index 63537f2..d18383a 100644 --- a/docs/resources/cname_record.md +++ b/docs/resources/cname_record.md @@ -10,7 +10,15 @@ description: |- CNAME record resource +## Example Usage +```terraform +resource "octodns_cname_record" "cname" { + zone = "example.com" + name = "cname" + values = ["unit.tests."] +} +``` ## Schema @@ -18,13 +26,13 @@ CNAME record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/dname_record.md b/docs/resources/dname_record.md index ba6fcae..8bf53b5 100644 --- a/docs/resources/dname_record.md +++ b/docs/resources/dname_record.md @@ -10,7 +10,15 @@ description: |- DNAME record resource +## Example Usage +```terraform +resource "octodns_dname_record" "dname" { + zone = "example.com" + name = "dname" + values = ["unit.tests."] +} +``` ## Schema @@ -18,13 +26,13 @@ DNAME record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/loc_record.md b/docs/resources/loc_record.md index b54655a..11339de 100644 --- a/docs/resources/loc_record.md +++ b/docs/resources/loc_record.md @@ -10,7 +10,53 @@ description: |- LOC record resource - +## Example Usage + +```terraform +locals { + + loc_raw = [ + { + altitude = 20 + lat_degrees = 31 + lat_direction = "S" + lat_minutes = 58 + lat_seconds = 52.1 + long_degrees = 115 + long_direction = "E" + long_minutes = 49 + long_seconds = 11.7 + precision_horz = 10 + precision_vert = 2 + size = 10 + }, + { + altitude = 20 + lat_degrees = 53 + lat_direction = "N" + lat_minutes = 13 + lat_seconds = 10 + long_degrees = 2 + long_direction = "W" + long_minutes = 18 + long_seconds = 26 + precision_horz = 1000 + precision_vert = 2 + size = 10 + } + ] + + loc_values = [for v in local.loc_raw : + "${v.lat_degrees} ${v.lat_minutes} ${v.lat_seconds} ${v.lat_direction} ${v.long_degrees} ${v.long_minutes} ${v.long_seconds} ${v.long_direction} ${v.altitude} ${v.size} ${v.precision_horz} ${v.precision_vert}"] + +} + +resource "octodns_loc_record" "loc" { + zone = "example.com" + name = "loc" + values = local.loc_values +} +``` ## Schema @@ -18,13 +64,13 @@ LOC record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/mx_record.md b/docs/resources/mx_record.md index 96a14ad..bfb3dcb 100644 --- a/docs/resources/mx_record.md +++ b/docs/resources/mx_record.md @@ -10,7 +10,15 @@ description: |- MX record resource +## Example Usage +```terraform +resource "octodns_mx_record" "mx" { + zone = "example.com" + name = "mx" + values = ["40 smtp-1.unit.tests.", "20 smtp-2.unit.tests."] +} +``` ## Schema @@ -18,13 +26,13 @@ MX record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/naptr_record.md b/docs/resources/naptr_record.md index aeef058..4c31fb1 100644 --- a/docs/resources/naptr_record.md +++ b/docs/resources/naptr_record.md @@ -10,7 +10,30 @@ description: |- NAPTR record resource +## Example Usage +```terraform +locals { + + naptr_raw = [{ + flags = "U" + order = 100 + preference = 100 + regexp = "'!^.*$!sip:info@bar.example.com!'" + replacement = "." + service = "SIP+D2U" + }] + + naptr_values = [for v in local.naptr_raw : "${v.order} ${v.preference} ${v.flags} ${v.service} ${v.regexp} ${v.replacement}"] + +} + +resource "octodns_naptr_record" "naptr" { + zone = "example.com" + name = "naptr" + values = local.naptr_values +} +``` ## Schema @@ -18,13 +41,13 @@ NAPTR record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/ns_record.md b/docs/resources/ns_record.md index 0468bd7..9b80467 100644 --- a/docs/resources/ns_record.md +++ b/docs/resources/ns_record.md @@ -10,7 +10,16 @@ description: |- NS record resource +## Example Usage +```terraform +resource "octodns_ns_record" "root" { + zone = "example.com" + name = "@" + ttl = 300 + values = ["2.2.2.2", "3.3.3.3"] +} +``` ## Schema @@ -18,13 +27,13 @@ NS record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/ptr_record.md b/docs/resources/ptr_record.md index 3ad57f9..c83f584 100644 --- a/docs/resources/ptr_record.md +++ b/docs/resources/ptr_record.md @@ -18,13 +18,13 @@ PTR record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/spf_record.md b/docs/resources/spf_record.md index 7d52361..1a876ef 100644 --- a/docs/resources/spf_record.md +++ b/docs/resources/spf_record.md @@ -18,13 +18,13 @@ SPF record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/srv_record.md b/docs/resources/srv_record.md index 8f3ef1e..1388eea 100644 --- a/docs/resources/srv_record.md +++ b/docs/resources/srv_record.md @@ -10,7 +10,41 @@ description: |- SRV record resource - +## Example Usage + +```terraform +locals { + + srv_raw = [ + { + service = "imap" + protocol = "tcp" + port = 30 + priority = 12 + target = "foo-2.unit.tests." + weight = 20 + }, { + service = "imap" + protocol = "tcp" + port = 30 + priority = 10 + target = "foo-1.unit.tests." + weight = 20 + } + ] + + srv_values = { for v in local.srv_raw : "_${v.service}._${v.protocol}" => "${v.priority} ${v.weight} ${v.port} ${v.target}"... } + +} + +resource "octodns_srv_record" "root" { + for_each = local.srv_values + zone = "example.com" + name = each.key + ttl = 600 + values = each.value +} +``` ## Schema @@ -18,13 +52,13 @@ SRV record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/sshfp_record.md b/docs/resources/sshfp_record.md index e02b140..88f9c4a 100644 --- a/docs/resources/sshfp_record.md +++ b/docs/resources/sshfp_record.md @@ -10,7 +10,28 @@ description: |- SSHFP record resource +## Example Usage +```terraform +locals { + + sshfp_raw = [ + { algorithm = 1, fingerprint = "bf6b6825d2977c511a475bbefb88aad54a92ac73", fingerprint_type = 1 }, + { algorithm = 1, fingerprint = "7491973e5f8b39d5327cd4e08bc81b05f7710b49", fingerprint_type = 1 } + ] + + sshfp_values = [for v in local.sshfp_raw : "${v.algorithm} ${v.fingerprint_type} ${v.fingerprint}"] + +} + +resource "octodns_sshfp_record" "root" { + zone = "example.com" + name = "@" + ttl = 300 + values = local.sshfp_values + +} +``` ## Schema @@ -18,13 +39,13 @@ SSHFP record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/txt_record.md b/docs/resources/txt_record.md index f6032e2..5ebc6c5 100644 --- a/docs/resources/txt_record.md +++ b/docs/resources/txt_record.md @@ -13,10 +13,15 @@ TXT record resource ## Example Usage ```terraform -resource "octodns_txt_record" "minimal" { - zone = "example.com" - name = "www" - values = ["v=spf1 a -all"] +resource "octodns_txt_record" "root" { + zone = "example.com" + name = "@" + ttl = 300 + values = [ + "Bah bah black sheep", + "have you any wool.", + "v=DKIM1\\;k=rsa\\;s=email\\;h=sha256\\;p=A/kinda+of/long/string+with+numb3rs", + ] } ``` @@ -26,13 +31,13 @@ resource "octodns_txt_record" "minimal" { ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/docs/resources/urlfwd_record.md b/docs/resources/urlfwd_record.md index 84b5a49..d53c7e2 100644 --- a/docs/resources/urlfwd_record.md +++ b/docs/resources/urlfwd_record.md @@ -10,7 +10,29 @@ description: |- URLFWD record resource +## Example Usage +```terraform +locals { + + urlfwd_raw = [{ + code = 302 + masking = 2 + path = "/" + query = 0 + target = "http://www.unit.tests" + }] + + urlfwd_values = [for v in local.urlfwd_raw : "${v.code} ${v.masking} ${v.path} ${v.query} ${v.target}"] + +} + +resource "octodns_urlfwd_record" "urlfwd" { + zone = "example.com" + name = "urlfwd" + values = local.urlfwd_values +} +``` ## Schema @@ -18,13 +40,13 @@ URLFWD record resource ### Required - `name` (String) Record name. eq: .example.com -- `scope` (String) Scope of zone - `values` (List of String) - `zone` (String) Zone of the record. eq: example.com ### Optional - `octodns` (Attributes) Additional octodns config for the records (see [below for nested schema](#nestedatt--octodns)) +- `scope` (String) Scope of zone - `ttl` (Number) TTL of the record, leave empty for zone of server defaults ### Read-Only diff --git a/examples/data-sources/data-source.tf b/examples/data-sources/data-source.tf new file mode 100644 index 0000000..139597f --- /dev/null +++ b/examples/data-sources/data-source.tf @@ -0,0 +1,2 @@ + + diff --git a/examples/data-sources/octodns_a_record/data-source.tf b/examples/data-sources/octodns_a_record/data-source.tf index 5be1917..045942e 100644 --- a/examples/data-sources/octodns_a_record/data-source.tf +++ b/examples/data-sources/octodns_a_record/data-source.tf @@ -1,11 +1,9 @@ -data "octodns_a_record" "default_scope" { - zone = "example.com" +data "octodns_a_record" "root" { + zone = "unit.tests" name = "@" } +output "a_record" { + value = data.octodns_a_record.root +} -data "octodns_a_record" "custom_scope" { - zone = "example.com" - scope = "internal" - name = "www" -} diff --git a/examples/data-sources/octodns_aaaa_record/data-source.tf b/examples/data-sources/octodns_aaaa_record/data-source.tf new file mode 100644 index 0000000..2934d4e --- /dev/null +++ b/examples/data-sources/octodns_aaaa_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_aaaa_record" "aaaa" { + zone = "unit.tests" + name = "aaaa" +} +output "aaaa_record" { + value = data.octodns_aaaa_record.aaaa +} + + diff --git a/examples/data-sources/octodns_caa_record/data-source.tf b/examples/data-sources/octodns_caa_record/data-source.tf new file mode 100644 index 0000000..fb20604 --- /dev/null +++ b/examples/data-sources/octodns_caa_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_caa_record" "root" { + zone = "unit.tests" + name = "@" +} +output "caa_record" { + value = data.octodns_caa_record.root +} + + diff --git a/examples/data-sources/octodns_cname_record/data-source.tf b/examples/data-sources/octodns_cname_record/data-source.tf new file mode 100644 index 0000000..38a4b53 --- /dev/null +++ b/examples/data-sources/octodns_cname_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_cname_record" "cname" { + zone = "unit.tests" + name = "cname" +} +output "cname_record" { + value = data.octodns_cname_record.cname +} + + diff --git a/examples/data-sources/octodns_dname_record/data-source.tf b/examples/data-sources/octodns_dname_record/data-source.tf new file mode 100644 index 0000000..57f9e25 --- /dev/null +++ b/examples/data-sources/octodns_dname_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_dname_record" "dname" { + zone = "unit.tests" + name = "dname" +} +output "dname_record" { + value = data.octodns_dname_record.dname +} + + diff --git a/examples/data-sources/octodns_loc_record/data-source.tf b/examples/data-sources/octodns_loc_record/data-source.tf new file mode 100644 index 0000000..d11e553 --- /dev/null +++ b/examples/data-sources/octodns_loc_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_loc_record" "loc" { + zone = "unit.tests" + name = "loc" +} +output "loc_record" { + value = data.octodns_loc_record.loc +} + + diff --git a/examples/data-sources/octodns_mx_record/data-source.tf b/examples/data-sources/octodns_mx_record/data-source.tf new file mode 100644 index 0000000..04922b3 --- /dev/null +++ b/examples/data-sources/octodns_mx_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_mx_record" "mx" { + zone = "unit.tests" + name = "mx" +} +output "mx_record" { + value = data.octodns_mx_record.mx +} + + diff --git a/examples/data-sources/octodns_naptr_record/data-source.tf b/examples/data-sources/octodns_naptr_record/data-source.tf new file mode 100644 index 0000000..b640d44 --- /dev/null +++ b/examples/data-sources/octodns_naptr_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_naptr_record" "naptr" { + zone = "unit.tests" + name = "naptr" +} +output "naptr_record" { + value = data.octodns_naptr_record.naptr +} + + diff --git a/examples/data-sources/octodns_ns_record/data-source.tf b/examples/data-sources/octodns_ns_record/data-source.tf new file mode 100644 index 0000000..75e75e8 --- /dev/null +++ b/examples/data-sources/octodns_ns_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_ns_record" "root" { + zone = "unit.tests" + name = "@" +} +output "ns_record" { + value = data.octodns_ns_record.root +} + + diff --git a/examples/data-sources/octodns_srv_record/data-source.tf b/examples/data-sources/octodns_srv_record/data-source.tf new file mode 100644 index 0000000..81604ed --- /dev/null +++ b/examples/data-sources/octodns_srv_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_srv_record" "root" { + zone = "unit.tests" + name = "_imap._tcp" +} +output "srv_record" { + value = data.octodns_srv_record.root +} + + diff --git a/examples/data-sources/octodns_sshfp_record/data-source.tf b/examples/data-sources/octodns_sshfp_record/data-source.tf new file mode 100644 index 0000000..d401df8 --- /dev/null +++ b/examples/data-sources/octodns_sshfp_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_sshfp_record" "root" { + zone = "unit.tests" + name = "@" +} +output "sshfp_record" { + value = data.octodns_sshfp_record.root +} + + diff --git a/examples/data-sources/octodns_txt_record/data-source.tf b/examples/data-sources/octodns_txt_record/data-source.tf new file mode 100644 index 0000000..629c182 --- /dev/null +++ b/examples/data-sources/octodns_txt_record/data-source.tf @@ -0,0 +1,9 @@ +data "octodns_txt_record" "txt" { + zone = "unit.tests" + name = "txt" +} +output "txt_record" { + value = data.octodns_txt_record.txt +} + + diff --git a/examples/data-sources/octodns_urlfwd_record/data-source.tf b/examples/data-sources/octodns_urlfwd_record/data-source.tf new file mode 100644 index 0000000..3680c2e --- /dev/null +++ b/examples/data-sources/octodns_urlfwd_record/data-source.tf @@ -0,0 +1,19 @@ +data "octodns_urlfwd_record" "urlfwd" { + zone = "unit.tests" + name = "urlfwd" +} +output "urlfwd_record" { + value = data.octodns_urlfwd_record.urlfwd +} + + + + + + + + + + + + diff --git a/examples/resources/octodns_a_record/resource.tf b/examples/resources/octodns_a_record/resource.tf index 7acea34..334fd5a 100644 --- a/examples/resources/octodns_a_record/resource.tf +++ b/examples/resources/octodns_a_record/resource.tf @@ -1,17 +1,8 @@ -resource "octodns_a_record" "localhost" { +resource "octodns_a_record" "root" { zone = "example.com" - name = "localhost" - ttl = 3600 - values = ["127.0.0.1"] - octodns = { - cloudflare = { - proxied = true - } - } + name = "@" + ttl = 300 + values = ["1.2.3.4", "5.6.7.8"] } -resource "octodns_a_record" "minimal" { - zone = "example.com" - name = "www" - values = ["127.0.0.1"] -} + diff --git a/examples/resources/octodns_aaaa_record/resource.tf b/examples/resources/octodns_aaaa_record/resource.tf new file mode 100644 index 0000000..a60ed46 --- /dev/null +++ b/examples/resources/octodns_aaaa_record/resource.tf @@ -0,0 +1,7 @@ +resource "octodns_aaaa_record" "aaaa" { + zone = "example.com" + name = "aaaa" + values = ["2601:644:500:e210:62f8:1dff:feb8:947a"] +} + + diff --git a/examples/resources/octodns_caa_record/resource.tf b/examples/resources/octodns_caa_record/resource.tf new file mode 100644 index 0000000..609f01c --- /dev/null +++ b/examples/resources/octodns_caa_record/resource.tf @@ -0,0 +1,18 @@ +locals { + + caa_raw = [ + { flags = 30, tag = "issue", value = "ca.unit.tests" }, + ] + + caa_values = [for v in local.caa_raw : "${v.flags} ${v.tag} ${v.value}"] + +} + +resource "octodns_caa_record" "root" { + zone = "example.com" + name = "@" + ttl = 300 + values = local.caa_values +} + + diff --git a/examples/resources/octodns_cname_record/resource.tf b/examples/resources/octodns_cname_record/resource.tf new file mode 100644 index 0000000..9b126dd --- /dev/null +++ b/examples/resources/octodns_cname_record/resource.tf @@ -0,0 +1,7 @@ +resource "octodns_cname_record" "cname" { + zone = "example.com" + name = "cname" + values = ["unit.tests."] +} + + diff --git a/examples/resources/octodns_dname_record/resource.tf b/examples/resources/octodns_dname_record/resource.tf new file mode 100644 index 0000000..ca2c4f9 --- /dev/null +++ b/examples/resources/octodns_dname_record/resource.tf @@ -0,0 +1,7 @@ +resource "octodns_dname_record" "dname" { + zone = "example.com" + name = "dname" + values = ["unit.tests."] +} + + diff --git a/examples/resources/octodns_loc_record/resource.tf b/examples/resources/octodns_loc_record/resource.tf new file mode 100644 index 0000000..1cb4389 --- /dev/null +++ b/examples/resources/octodns_loc_record/resource.tf @@ -0,0 +1,45 @@ +locals { + + loc_raw = [ + { + altitude = 20 + lat_degrees = 31 + lat_direction = "S" + lat_minutes = 58 + lat_seconds = 52.1 + long_degrees = 115 + long_direction = "E" + long_minutes = 49 + long_seconds = 11.7 + precision_horz = 10 + precision_vert = 2 + size = 10 + }, + { + altitude = 20 + lat_degrees = 53 + lat_direction = "N" + lat_minutes = 13 + lat_seconds = 10 + long_degrees = 2 + long_direction = "W" + long_minutes = 18 + long_seconds = 26 + precision_horz = 1000 + precision_vert = 2 + size = 10 + } + ] + + loc_values = [for v in local.loc_raw : + "${v.lat_degrees} ${v.lat_minutes} ${v.lat_seconds} ${v.lat_direction} ${v.long_degrees} ${v.long_minutes} ${v.long_seconds} ${v.long_direction} ${v.altitude} ${v.size} ${v.precision_horz} ${v.precision_vert}"] + +} + +resource "octodns_loc_record" "loc" { + zone = "example.com" + name = "loc" + values = local.loc_values +} + + diff --git a/examples/resources/octodns_mx_record/resource.tf b/examples/resources/octodns_mx_record/resource.tf new file mode 100644 index 0000000..7f6eaf8 --- /dev/null +++ b/examples/resources/octodns_mx_record/resource.tf @@ -0,0 +1,8 @@ +resource "octodns_mx_record" "mx" { + zone = "example.com" + name = "mx" + values = ["40 smtp-1.unit.tests.", "20 smtp-2.unit.tests."] +} + + + diff --git a/examples/resources/octodns_naptr_record/resource.tf b/examples/resources/octodns_naptr_record/resource.tf new file mode 100644 index 0000000..1ba0c0a --- /dev/null +++ b/examples/resources/octodns_naptr_record/resource.tf @@ -0,0 +1,23 @@ +locals { + + naptr_raw = [{ + flags = "U" + order = 100 + preference = 100 + regexp = "'!^.*$!sip:info@bar.example.com!'" + replacement = "." + service = "SIP+D2U" + }] + + naptr_values = [for v in local.naptr_raw : "${v.order} ${v.preference} ${v.flags} ${v.service} ${v.regexp} ${v.replacement}"] + +} + +resource "octodns_naptr_record" "naptr" { + zone = "example.com" + name = "naptr" + values = local.naptr_values +} + + + diff --git a/examples/resources/octodns_ns_record/resource.tf b/examples/resources/octodns_ns_record/resource.tf new file mode 100644 index 0000000..5797042 --- /dev/null +++ b/examples/resources/octodns_ns_record/resource.tf @@ -0,0 +1,8 @@ +resource "octodns_ns_record" "root" { + zone = "example.com" + name = "@" + ttl = 300 + values = ["2.2.2.2", "3.3.3.3"] +} + + diff --git a/examples/resources/octodns_srv_record/resource.tf b/examples/resources/octodns_srv_record/resource.tf new file mode 100644 index 0000000..bfbb58f --- /dev/null +++ b/examples/resources/octodns_srv_record/resource.tf @@ -0,0 +1,33 @@ +locals { + + srv_raw = [ + { + service = "imap" + protocol = "tcp" + port = 30 + priority = 12 + target = "foo-2.unit.tests." + weight = 20 + }, { + service = "imap" + protocol = "tcp" + port = 30 + priority = 10 + target = "foo-1.unit.tests." + weight = 20 + } + ] + + srv_values = { for v in local.srv_raw : "_${v.service}._${v.protocol}" => "${v.priority} ${v.weight} ${v.port} ${v.target}"... } + +} + +resource "octodns_srv_record" "root" { + for_each = local.srv_values + zone = "example.com" + name = each.key + ttl = 600 + values = each.value +} + + diff --git a/examples/resources/octodns_sshfp_record/resource.tf b/examples/resources/octodns_sshfp_record/resource.tf new file mode 100644 index 0000000..675f940 --- /dev/null +++ b/examples/resources/octodns_sshfp_record/resource.tf @@ -0,0 +1,19 @@ +locals { + + sshfp_raw = [ + { algorithm = 1, fingerprint = "bf6b6825d2977c511a475bbefb88aad54a92ac73", fingerprint_type = 1 }, + { algorithm = 1, fingerprint = "7491973e5f8b39d5327cd4e08bc81b05f7710b49", fingerprint_type = 1 } + ] + + sshfp_values = [for v in local.sshfp_raw : "${v.algorithm} ${v.fingerprint_type} ${v.fingerprint}"] + +} + +resource "octodns_sshfp_record" "root" { + zone = "example.com" + name = "@" + ttl = 300 + values = local.sshfp_values + +} + diff --git a/examples/resources/octodns_txt_record/resource.tf b/examples/resources/octodns_txt_record/resource.tf index 8d866f1..b22de43 100644 --- a/examples/resources/octodns_txt_record/resource.tf +++ b/examples/resources/octodns_txt_record/resource.tf @@ -1,5 +1,12 @@ -resource "octodns_txt_record" "minimal" { - zone = "example.com" - name = "www" - values = ["v=spf1 a -all"] +resource "octodns_txt_record" "root" { + zone = "example.com" + name = "@" + ttl = 300 + values = [ + "Bah bah black sheep", + "have you any wool.", + "v=DKIM1\\;k=rsa\\;s=email\\;h=sha256\\;p=A/kinda+of/long/string+with+numb3rs", + ] } + + diff --git a/examples/resources/octodns_urlfwd_record/resource.tf b/examples/resources/octodns_urlfwd_record/resource.tf new file mode 100644 index 0000000..20c60a6 --- /dev/null +++ b/examples/resources/octodns_urlfwd_record/resource.tf @@ -0,0 +1,20 @@ +locals { + + urlfwd_raw = [{ + code = 302 + masking = 2 + path = "/" + query = 0 + target = "http://www.unit.tests" + }] + + urlfwd_values = [for v in local.urlfwd_raw : "${v.code} ${v.masking} ${v.path} ${v.query} ${v.target}"] + +} + +resource "octodns_urlfwd_record" "urlfwd" { + zone = "example.com" + name = "urlfwd" + values = local.urlfwd_values +} + diff --git a/examples/resources/resource.tf b/examples/resources/resource.tf new file mode 100644 index 0000000..32eb875 --- /dev/null +++ b/examples/resources/resource.tf @@ -0,0 +1,16 @@ + +/* +locals { + + type_raw = [ + { + value = 30 + } + ] + + type_values = [ for v in local.type_raw : "${v.value}" ] + +} +*/ + +