Created
July 8, 2019 13:48
-
-
Save wgebis/2b6c67e80b94e3e834a4d080eb83efc1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
resource "mailgun_domain" "example_mailing_domain" { | |
name = "m.example.com" | |
spam_action = "disabled" | |
smtp_password = "strong_password" | |
} | |
resource "cloudflare_record" "mail-receiving-dns-entry" { | |
count = 2 | |
domain = "${cloudflare_zone.my_domain_entry.zone}" | |
type = "${lookup(mailgun_domain.example_mailing_domain.receiving_records[count.index], "record_type")}" | |
name = "${mailgun_domain.example_mailing_domain.name}." | |
value = "${lookup(mailgun_domain.example_mailing_domain.receiving_records[count.index], "value")}" | |
priority = "${lookup(mailgun_domain.example_mailing_domain.receiving_records[count.index], "priority")}" | |
} | |
resource "cloudflare_record" "mail-sending-dns-entry" { | |
count = 3 | |
domain = "${cloudflare_zone.my_domain_entry.zone}" | |
type = "${lookup(mailgun_domain.example_mailing_domain.sending_records[count.index], "record_type")}" | |
name = "${lookup(mailgun_domain.example_mailing_domain.sending_records[count.index], "name")}." | |
value = "${lookup(mailgun_domain.example_mailing_domain.sending_records[count.index], "value")}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment