Terraform Module to set-up the MX Records for fastmail
This was developed primarily for myself, but I am releasing it in the hopes it helps someone else. This works only with Cloudflare DNS.
This will create the DNS records necessary to set up your domain name with fastmail. This configures SPF, DKIM, and DMARC properly as well.
This can be found on the Terraform Registry.
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 3.0"
}
}
}
provider "cloudflare" {
api_token = var.cf_api_token
}
module "fastmail" {
source = "robbyoconnor/fastmail-mx/cloudflare"
version = "1.0.0"
cf_zone_id = var.cf_zone_id
cf_api_token = var.cf_api_token
domain_name = "example.com"
}
Name | Version |
---|---|
cloudflare | ~> 3.0 |
Name | Version |
---|---|
cloudflare | ~> 3.0 |
No modules.
Name | Type |
---|---|
cloudflare_record.dkim | resource |
cloudflare_record.dmarc | resource |
cloudflare_record.mx | resource |
cloudflare_record.spf | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
cf_api_token | This is the API token. You can obtain it at https://dash.cloudflare.com/profile/api-tokens | string |
n/a | yes |
cf_zone_id | The ID of the cloudflare zone | string |
n/a | yes |
dmarc | DMARC specification (optional) | string |
"" |
no |
domain_name | The apex domain name (e.g., example.com) | string |
n/a | yes |
sub_domain | The sub-domain for the MX records, if applicable (optional) | string |
"@" |
no |
ttl | TTL for the DNS records (optional) | number |
300 |
no |
No outputs.