Commit 2d9871b2 authored by Mike Horwath's avatar Mike Horwath
Browse files

updated docs to use less resource names

parent 0f942be1
Pipeline #103 failed with stages
in 12 seconds
# Cloudflare DNS Record Module
[Terraform cloudflare_record](https://www.terraform.io/docs/providers/cloudflare/r/record.html)
Terraform [cloudflare_record](https://www.terraform.io/docs/providers/cloudflare/r/record.html)
This module will loop over a passed `map` and `list` variables to create records in Cloudflare. (see TODO below)
This module will loop over a passed `list` variables to create records in Cloudflare.
Suggestion: you should use durable state storage.
This module supports:
- IPv4 records both proxied and non-proxy
- IPv6 records both proxied and non-proxy
- SPF records
- TXT records
- MX records (requires a list of lists and not a map)
This works great with Terraform [Workspaces](https://www.terraform.io/docs/state/workspaces.html)
## usage example
......@@ -20,15 +13,7 @@ This works great with Terraform [Workspaces](https://www.terraform.io/docs/state
module "cloudflare_dns_records" {
source = "git::https://gitlab.com/geekandi-terraform/cloudflare-dns-record-module.git"
domain = "${var.domain}"
"noproxy_cnames" = "${var.noproxy_cnames}"
"noproxy_hosts_ipv4" = "${var.noproxy_hosts_ipv4}"
"noproxy_hosts_ipv6" = "${var.noproxy_hosts_ipv6}"
"proxy_cnames" = "${var.proxy_cnames}"
"proxy_hosts_ipv4" = "${var.proxy_hosts_ipv4}"
"proxy_hosts_ipv6" = "${var.proxy_hosts_ipv6}"
"spf_records" = "${var.spf_records}"
"text_records" = "${var.text_records}"
"mx_records" = "${var.mx_records}"
"multi_records" = "${var.multi_records}"
}
```
......@@ -36,51 +21,28 @@ your `example.vars` file
```
domain = "example.com"
proxy_hosts_ipv4 = {
"www" = "192.168.241.11"
"example.com" = "192.168.241.11"
}
multi_records = [
["example.com", "204.255.255.131", 0, "A", "true"],
["www", "204.255.255.131", 0, "A", "true"],
proxy_hosts_ipv6 = {
"www" = "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
"example.com" = "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
}
noproxy_hosts_ipv4 = {
"hostname01" = "192.168.240.12"
"hostname02" = "192.168.240.13"
}
["egads", "192.168.31.31", 0, "A", "false"],
noproxy_hosts_ipv6 = {
"hostname01" = "fe80::0202:b3ff:fe1e:8329"
"hostname02" = "fe80::0202:b3ff:fe1e:8329"
}
["example.com", "2b:12b::131", 0, "AAAA", "true"],
["www", "2b:12b::131", 0, "AAAA", "true"],
proxy_cnames = {
"googs" = "domains.google.com"
}
["egads", "2b:12b::deadbeef", 0, "AAAA", "false"],
noproxy_cnames = {
"o331n2f3fb" = "cname.bitly.com"
}
text_records = {
"_keybase" = "keybase-site-verification=a_random/string"
"example.com" = "google-site-verification=gibberish"
"example.com" = "v=spf1 -all"
"www" = "v=spf1 -all"
}
["example.com", "mail.example.com", "10", "MX", "false"],
["example.com", "mail2.example.com", "20", "MX", "false"],
["example.com", "v=spf1 ptr ip6:2001:4980:3333::/48 ip4:204.153.244.0/22 ~all", 0, "SPF", "false"],
["www", "v=spf1 -all", 0, "SPF", "false"],
spf_records = {
"example.com" = "v=spf1 -all"
"www" = "v=spf1 -all"
}
mx_records = [
["example.com", "mx1.example.com", "10"],
["example.com", "mx1.example.com", "20"],
["example.com", "mx1.example.com", "30"],
["example.com", "mx1.example.com", "40"],
["example.com", "v=spf1 ptr ip6:2001:4980:3333::/48 ip4:204.153.244.0/22 ~all", 0, "TXT", "false"],
["www", "v=spf1 -all", 0, "TXT", "false"],
]
```
......@@ -98,16 +60,8 @@ terraform workspace select default
* `domain` - the domain we are working against
## optional variables
* `mx_records` - List of triplets for FQDN, destination, priority
* `proxy_cnames` - CNAME values that utilize proxy
* `noproxy_cnames` - CNAME values that bypass proxy
* `proxy_hosts_ipv4` - A values that utilize proxy
* `noproxy_hosts_ipv4` - A values that bypass proxy
* `proxy_hosts_ipv6` - AAAA values that utilize proxy
* `noproxy_hosts_ipv6` - AAAA values that bypass proxy
* `spf_records` - SPF type records
* `text_records` - TXT type records
* `multi_records` - `name`, `value`, `priority (integer)`, `type`, `proxied`
## TODO
- add the rest of the DNS types
- rewrite things to use list of lists everywhere as this will allow for smaller number of distinct `resource` record types and simplifying things
- add examples for the rest of the DNS types
- figure out items for SRV and LOC records
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment