diff --git a/main.tf b/main.tf index ffb9d4f..2e0bec7 100644 --- a/main.tf +++ b/main.tf @@ -69,6 +69,10 @@ module "dns_staging" { resource_group_location = local.resource_group_location zone_name = "tietokila.fi" } +module "dns_m0" { + source = "./modules/dns/m0" + resource_group_location = local.resource_group_location +} module "mailman" { source = "./modules/dns/mailman" diff --git a/modules/dns/m0/main.tf b/modules/dns/m0/main.tf new file mode 100644 index 0000000..ab3649d --- /dev/null +++ b/modules/dns/m0/main.tf @@ -0,0 +1,18 @@ +resource "azurerm_resource_group" "dns_rg" { + name = "dns-m0-rg" + location = var.resource_group_location +} + +resource "azurerm_dns_zone" "root_zone" { + name = "muistinnollaus.fi" + resource_group_name = "dns-m0-rg" +} + +# CNAME record for www. +resource "azurerm_dns_cname_record" "www_cname" { + name = "www" + resource_group_name = azurerm_resource_group.dns_rg.name + zone_name = azurerm_dns_zone.root_zone.name + ttl = 300 + record = azurerm_dns_zone.root_zone.name +} diff --git a/modules/dns/m0/variables.tf b/modules/dns/m0/variables.tf new file mode 100644 index 0000000..281a093 --- /dev/null +++ b/modules/dns/m0/variables.tf @@ -0,0 +1,3 @@ +variable "resource_group_location" { + type = string +}