Commit 7f07fdf3 authored by Mike Horwath's avatar Mike Horwath
Browse files

shortened up a lot

parent 65221c09
Pipeline #63 failed with stages
......@@ -75,20 +75,12 @@ spf_records = {
"www" = "v=spf1 -all"
}
mx_10_records = [
["example.com", "mx1.example.com"],
["example.com", "mx1.example.com"],
["example.com", "mx1.example.com"],
["example.com", "mx1.example.com"],
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"],
]
mx_15_1_records = []
mx_15_2_records = []
mx_20_1_records = []
mx_20_2_records = []
```
## example command lines
......@@ -102,6 +94,7 @@ terraform apply -var-file examples.var example.tfplan
* `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
......
resource "cloudflare_record" "mx_10" {
count = "${length(var.mx_10_records)}"
resource "cloudflare_record" "mx" {
count = "${length(var.mx_records)}"
domain = "${var.domain}"
name = "${element(var.mx_10_records[count.index], 0)}"
value = "${element(var.mx_10_records[count.index], 1)}"
name = "${element(var.mx_records[count.index], 0)}"
value = "${element(var.mx_records[count.index], 1)}"
priority = "${element(var.mx_records[count.index], 2)}"
type = "MX"
priority = "10"
proxied = false
}
resource "cloudflare_record" "mx_15_1" {
count = "${length(var.mx_15_1_records)}"
domain = "${var.domain}"
name = "${element(keys(var.mx_15_1_records), count.index)}"
value = "${element(values(var.mx_15_1_records), count.index)}"
type = "MX"
priority = "15"
proxied = false
}
resource "cloudflare_record" "mx_15_2" {
count = "${length(var.mx_15_2_records)}"
domain = "${var.domain}"
name = "${element(keys(var.mx_15_2_records), count.index)}"
value = "${element(values(var.mx_15_2_records), count.index)}"
type = "MX"
priority = "15"
proxied = false
}
resource "cloudflare_record" "mx_20_1" {
count = "${length(var.mx_20_1_records)}"
domain = "${var.domain}"
name = "${element(keys(var.mx_20_1_records), count.index)}"
value = "${element(values(var.mx_20_1_records), count.index)}"
type = "MX"
priority = "20"
proxied = false
}
resource "cloudflare_record" "mx_20_2" {
count = "${length(var.mx_20_2_records)}"
domain = "${var.domain}"
name = "${element(keys(var.mx_20_2_records), count.index)}"
value = "${element(values(var.mx_20_2_records), count.index)}"
type = "MX"
priority = "20"
proxied = false
}
......@@ -40,27 +40,7 @@ variable "spf_records" {
default = {}
}
variable "mx_10_records" {
type = "list"
default = []
}
variable "mx_15_1_records" {
type = "list"
default = []
}
variable "mx_15_2_records" {
type = "list"
default = []
}
variable "mx_20_1_records" {
type = "list"
default = []
}
variable "mx_20_2_records" {
variable "mx_records" {
type = "list"
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