Skip to content

Commit

Permalink
add m0-dns-zone
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Jan 18, 2024
1 parent 3b2d60e commit cf85ccf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 18 additions & 0 deletions modules/dns/m0/main.tf
Original file line number Diff line number Diff line change
@@ -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
}
3 changes: 3 additions & 0 deletions modules/dns/m0/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "resource_group_location" {
type = string
}

0 comments on commit cf85ccf

Please sign in to comment.