Commit 6033f820 authored by Mike Horwath's avatar Mike Horwath

terraform 0.12

parent f5a193d4
Pipeline #189 failed with stages
in 57 seconds
resource "cloudflare_record" "caa" {
count = "${length(var.caa_records)}"
domain = "${var.domain}"
name = "${element(var.caa_records[count.index], 0)}"
count = length(var.caa_records)
domain = var.domain
name = element(var.caa_records[count.index], 0)
type = "CAA"
data = {
flags = "${element(var.caa_records[count.index], 1)}"
tag = "${element(var.caa_records[count.index], 2)}"
value = "${element(var.caa_records[count.index], 3)}"
flags = element(var.caa_records[count.index], 1)
tag = element(var.caa_records[count.index], 2)
value = element(var.caa_records[count.index], 3)
}
}
resource "cloudflare_record" "multi" {
count = "${length(var.multi_records)}"
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
count = length(var.multi_records)
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
}
resource "cloudflare_record" "srv" {
count = "${length(var.srv_records)}"
domain = "${var.domain}"
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)}"
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)
}
}
variable "domain" {}
variable "domain" {
}
# still need to figure out SRV and LOC records
# name, value, priority (integer), type, proxied
variable "multi_records" {
type = "list"
type = list(string)
default = []
}
# item, proto, priority (integer), weight (integer), port (integer), target (no trailing dot)
variable "srv_records" {
type = "list"
type = list(string)
default = []
}
# name, flags, tag, value
variable "caa_records" {
type = "list"
type = list(string)
default = []
}
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