Skip to content

Terraform modules to create DNS records across Cloudflare, Scaleway and OVH. Avoid lock-in, easily migrate, and more.

License

Notifications You must be signed in to change notification settings

conradkleinespel/tf-dns-multi-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DNS records across providers

This repo contains Terraform (or Tofu) modules to create DNS records the same way for a variety of hosted DNS providers.

The modules support the following providers:

  • Cloudflare;
  • Scaleway;
  • OVH.

And the following record types:

  • A;
  • CNAME;
  • MX;
  • SRV;
  • TXT.

Examples

A record

module "example-com-a" {
  source = "github.com/conradkleinespel/tf-dns-multi-cloud//dns/record_a"

  ip_addresses       = ["12.13.14.15", "13.14.15.16"]
  domain             = "www.example.com"
  dns_zone_domain    = "example.com"

  cloudflare_zone_id = cloudflare_zone.conradk_com.id

  cloudflare_enabled = true
  scaleway_enabled   = true
  ovh_enabled        = true
}

TXT record

module "example-com-txt" {
  source = "github.com/conradkleinespel/tf-dns-multi-cloud//dns/record_txt"

  domain             = "my-txt-domain.example.com"
  value              = "value without quotes"
  dns_zone_domain    = "example.com"

  cloudflare_zone_id = var.cloudflare_zone_id

  cloudflare_enabled = true
  scaleway_enabled   = true
  ovh_enabled        = true
}

MX record

module "example-com-mx" {
  source = "github.com/conradkleinespel/tf-dns-multi-cloud//dns/record_mx"

  domain             = "example.com"
  priority           = 10
  server             = "my-mx-server"
  dns_zone_domain    = "example.com"

  cloudflare_zone_id = var.cloudflare_zone_id

  cloudflare_enabled = true
  scaleway_enabled   = true
  ovh_enabled        = true
}

SRV record

module "example-com-srv" {
  source = "github.com/conradkleinespel/tf-dns-multi-cloud//dns/record_srv"

  service            = "_caldavs"
  proto              = "_tcp"
  priority           = 0
  weight             = 1
  port               = 443
  target             = "my-caldav-server"
  dns_zone_domain    = "example.com"

  cloudflare_zone_id = var.cloudflare_zone_id

  cloudflare_enabled = true
  scaleway_enabled   = true
  ovh_enabled        = true
}

CNAME record

module "example-com-cname" {
  source = "github.com/conradkleinespel/tf-dns-multi-cloud//dns/record_cname"

  domain             = "subdomain.example.com"
  value              = "my-cname-server"
  dns_zone_domain    = "example.com"

  cloudflare_zone_id = var.cloudflare_zone_id

  cloudflare_enabled = true
  scaleway_enabled   = true
  ovh_enabled        = true
}

License

The source code is released under the Apache 2.0 license.

About

Terraform modules to create DNS records across Cloudflare, Scaleway and OVH. Avoid lock-in, easily migrate, and more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published