Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
Fix allowing a non-default provider
Browse files Browse the repository at this point in the history
  • Loading branch information
bluk committed Dec 7, 2018
1 parent 5c08e2b commit 3375cf6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 61 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v0.2.1

* Fix using a non-default provider.

## v0.2.0

* Add `provider` and `ttl` options to enable customization.
Expand Down
99 changes: 38 additions & 61 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
provider "cloudflare" {}

resource "cloudflare_record" "mx_wildcard1" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "*"
type = "MX"
Expand All @@ -9,7 +10,6 @@ resource "cloudflare_record" "mx_wildcard1" {
}

resource "cloudflare_record" "mx_wildcard2" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "*"
type = "MX"
Expand All @@ -19,7 +19,6 @@ resource "cloudflare_record" "mx_wildcard2" {
}

resource "cloudflare_record" "mx_domain1" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "${var.domain_name}"
type = "MX"
Expand All @@ -29,7 +28,6 @@ resource "cloudflare_record" "mx_domain1" {
}

resource "cloudflare_record" "mx_domain2" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "${var.domain_name}"
type = "MX"
Expand All @@ -39,7 +37,6 @@ resource "cloudflare_record" "mx_domain2" {
}

resource "cloudflare_record" "mx_www1" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "www"
type = "MX"
Expand All @@ -49,7 +46,6 @@ resource "cloudflare_record" "mx_www1" {
}

resource "cloudflare_record" "mx_www2" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "www"
type = "MX"
Expand All @@ -59,26 +55,23 @@ resource "cloudflare_record" "mx_www2" {
}

resource "cloudflare_record" "root_domain_txt" {
provider = "${var.provider}"
count = "${var.create_root_domain_txt ? 1 : 0}"
domain = "${var.domain_name}"
name = "${var.domain_name}"
type = "TXT"
ttl = "${var.ttl}"
value = "\"v=spf1 include:spf.messagingengine.com ?all\""
count = "${var.create_root_domain_txt ? 1 : 0}"
domain = "${var.domain_name}"
name = "${var.domain_name}"
type = "TXT"
ttl = "${var.ttl}"
value = "\"v=spf1 include:spf.messagingengine.com ?all\""
}

resource "cloudflare_record" "adsp_domainkey_txt" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_adsp._domainkey.${var.domain_name}"
type = "TXT"
ttl = "${var.ttl}"
value = "dkim=unknown"
domain = "${var.domain_name}"
name = "_adsp._domainkey.${var.domain_name}"
type = "TXT"
ttl = "${var.ttl}"
value = "dkim=unknown"
}

resource "cloudflare_record" "client_smtp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_client._smtp.${var.domain_name}"
type = "SRV"
Expand All @@ -97,7 +90,6 @@ resource "cloudflare_record" "client_smtp_srv" {
}

resource "cloudflare_record" "caldav_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_caldav._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -116,7 +108,6 @@ resource "cloudflare_record" "caldav_tcp_srv" {
}

resource "cloudflare_record" "caldavs_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_caldavs._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -135,7 +126,6 @@ resource "cloudflare_record" "caldavs_tcp_srv" {
}

resource "cloudflare_record" "carddav_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_carddav._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -154,7 +144,6 @@ resource "cloudflare_record" "carddav_tcp_srv" {
}

resource "cloudflare_record" "carddavs_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_carddavs._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -173,7 +162,6 @@ resource "cloudflare_record" "carddavs_tcp_srv" {
}

resource "cloudflare_record" "imap_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_imap._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -192,7 +180,6 @@ resource "cloudflare_record" "imap_tcp_srv" {
}

resource "cloudflare_record" "imaps_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_imaps._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -211,7 +198,6 @@ resource "cloudflare_record" "imaps_tcp_srv" {
}

resource "cloudflare_record" "pop3_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_pop3._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -230,7 +216,6 @@ resource "cloudflare_record" "pop3_tcp_srv" {
}

resource "cloudflare_record" "pop3s_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_pop3s._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -249,7 +234,6 @@ resource "cloudflare_record" "pop3s_tcp_srv" {
}

resource "cloudflare_record" "submission_tcp_srv" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "_submission._tcp.${var.domain_name}"
type = "SRV"
Expand All @@ -268,25 +252,22 @@ resource "cloudflare_record" "submission_tcp_srv" {
}

resource "cloudflare_record" "mail_a1" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "mail.${var.domain_name}"
type = "A"
ttl = "${var.ttl}"
value = "66.111.4.147"
domain = "${var.domain_name}"
name = "mail.${var.domain_name}"
type = "A"
ttl = "${var.ttl}"
value = "66.111.4.147"
}

resource "cloudflare_record" "mail_a2" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "mail.${var.domain_name}"
type = "A"
ttl = "${var.ttl}"
value = "66.111.4.148"
domain = "${var.domain_name}"
name = "mail.${var.domain_name}"
type = "A"
ttl = "${var.ttl}"
value = "66.111.4.148"
}

resource "cloudflare_record" "mx_mail1" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "mail"
type = "MX"
Expand All @@ -296,7 +277,6 @@ resource "cloudflare_record" "mx_mail1" {
}

resource "cloudflare_record" "mx_mail2" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "mail"
type = "MX"
Expand All @@ -306,28 +286,25 @@ resource "cloudflare_record" "mx_mail2" {
}

resource "cloudflare_record" "fm1_domainkey_cname" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "fm1._domainkey.${var.domain_name}"
type = "CNAME"
ttl = "${var.ttl}"
value = "fm1.${var.domain_name}.dkim.fmhosted.com"
domain = "${var.domain_name}"
name = "fm1._domainkey.${var.domain_name}"
type = "CNAME"
ttl = "${var.ttl}"
value = "fm1.${var.domain_name}.dkim.fmhosted.com"
}

resource "cloudflare_record" "fm2_domainkey_cname" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "fm2._domainkey.${var.domain_name}"
type = "CNAME"
ttl = "${var.ttl}"
value = "fm2.${var.domain_name}.dkim.fmhosted.com"
domain = "${var.domain_name}"
name = "fm2._domainkey.${var.domain_name}"
type = "CNAME"
ttl = "${var.ttl}"
value = "fm2.${var.domain_name}.dkim.fmhosted.com"
}

resource "cloudflare_record" "fm3_domainkey_cname" {
provider = "${var.provider}"
domain = "${var.domain_name}"
name = "fm3._domainkey.${var.domain_name}"
type = "CNAME"
ttl = "${var.ttl}"
value = "fm3.${var.domain_name}.dkim.fmhosted.com"
domain = "${var.domain_name}"
name = "fm3._domainkey.${var.domain_name}"
type = "CNAME"
ttl = "${var.ttl}"
value = "fm3.${var.domain_name}.dkim.fmhosted.com"
}

0 comments on commit 3375cf6

Please sign in to comment.