Commit 6d52a5cc authored by Mike Horwath's avatar Mike Horwath
Browse files

adding new records

parent 0962cf21
Pipeline #160 failed with stages
in 36 seconds
resource "cloudflare_record" "multi" {
count = "${length(var.multi_records)}"
domain = "${var.domain}" # required
domain = "${var.domain}" # required
name = "${element(var.multi_records[count.index], 0)}" # required
value = "${element(var.multi_records[count.index], 1)}" # required
priority = "${element(var.multi_records[count.index], 2)}" # optional IRL, required in var passing, can be ""
type = "${element(var.multi_records[count.index], 3)}" # required
proxied = "${element(var.multi_records[count.index], 4)}" # optional IRL, required in var passing, boolean
ttl = "1" # this is default
ttl = "1" # this is default
}
resource "cloudflare_record" "srv" {
count = "${length(var.srv_records)}"
domain = "${var.domain}"
name = "${element(var.srv_records[count.index], 0)}.${element(var.srv_records[count.index], 1)}.${var.domain}"
type = "SRV"
data = {
service = "${element(var.srv_records[count.index], 0)}"
proto = "${element(var.srv_records[count.index], 1)}"
name = "${var.domain}."
priority = "${element(var.srv_records[count.index], 2)}"
weight = "${element(var.srv_records[count.index], 3)}"
port = "${element(var.srv_records[count.index], 4)}"
target = "${element(var.srv_records[count.index], 5)}."
}
}
......@@ -8,6 +8,12 @@ variable "multi_records" {
default = []
}
# item, proto, priority (integer), weight (integer), port (integer), target (no trailing dot)
variable "srv_records" {
type = "list"
default = []
}
# requires further investigation
# variable "caa_records" {
# type = "map"
......
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