-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from concourse/add-mailgun
add mailgun setup
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
data "google_dns_managed_zone" "main" { | ||
name = var.dns_zone | ||
} | ||
|
||
resource "google_dns_record_set" "mailgun_mx" { | ||
name = data.google_dns_managed_zone.main.dns_name | ||
type = "MX" | ||
ttl = 300 | ||
|
||
managed_zone = data.google_dns_managed_zone.main.name | ||
|
||
rrdatas = [ | ||
"10 mxa.mailgun.org", | ||
"10 mxb.mailgun.org" | ||
] | ||
} | ||
|
||
resource "google_dns_record_set" "mailgun_verification" { | ||
name = data.google_dns_managed_zone.main.dns_name | ||
type = "TXT" | ||
ttl = 300 | ||
|
||
managed_zone = data.google_dns_managed_zone.main.name | ||
|
||
rrdatas = [ | ||
"v=spf1 include:mailgun.org ~all" | ||
] | ||
} | ||
|
||
resource "google_dns_record_set" "mailgun_verification_domainkey" { | ||
name = "krs._domainkey.${data.google_dns_managed_zone.main.dns_name}" | ||
type = "TXT" | ||
ttl = 300 | ||
|
||
managed_zone = data.google_dns_managed_zone.main.name | ||
|
||
rrdatas = [ | ||
var.verification | ||
] | ||
} | ||
|
||
resource "google_dns_record_set" "mailgun_tracking" { | ||
name = "email.${data.google_dns_managed_zone.main.dns_name}" | ||
type = "CNAME" | ||
ttl = 300 | ||
|
||
managed_zone = data.google_dns_managed_zone.main.name | ||
|
||
rrdatas = [ | ||
"mailgun.org" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
variable "dns_zone" { | ||
description = "Name of the DNS zone" | ||
type = string | ||
} | ||
|
||
variable "verification" { | ||
description = "Verification domainkey value provided from Mailgun settings" | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters