Skip to content

Commit

Permalink
fix tenttiarkisto, for some reason isn't working :/
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Nov 7, 2023
1 parent 923b728 commit 2c85734
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions modules/tenttiarkisto/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ resource "azurerm_linux_web_app" "tenttiarkisto" {

resource "azurerm_dns_zone" "tenttiarkisto_zone" {
name = "tenttiarkisto.fi"
resource_group_name = azurerm_resource_group.tenttiarkisto_rg.name
resource_group_name = var.tikweb_app_plan_rg_name
}

# https://github.com/hashicorp/terraform-provider-azurerm/issues/14642#issuecomment-1084728235
Expand All @@ -104,23 +104,34 @@ data "dns_a_record_set" "tenttiarkisto_dns_fetch" {

resource "azurerm_dns_a_record" "tenttiarkisto_a" {
name = "@"
resource_group_name = azurerm_resource_group.tenttiarkisto_rg.name
resource_group_name = var.tikweb_app_plan_rg_name
zone_name = azurerm_dns_zone.tenttiarkisto_zone.name
ttl = 300
records = data.dns_a_record_set.tenttiarkisto_dns_fetch.addrs
}

resource "azurerm_dns_cname_record" "tenttiarkisto_cname_www" {
name = "www"
resource_group_name = azurerm_resource_group.tenttiarkisto_rg.name
resource_group_name = var.tikweb_app_plan_rg_name
zone_name = azurerm_dns_zone.tenttiarkisto_zone.name
ttl = 300
record = azurerm_linux_web_app.tenttiarkisto.default_hostname
}

resource "azurerm_dns_txt_record" "tenttiarkisto_txt_asuid" {
name = "asuid"
resource_group_name = azurerm_resource_group.tenttiarkisto_rg.name
resource_group_name = var.tikweb_app_plan_rg_name
zone_name = azurerm_dns_zone.tenttiarkisto_zone.name
ttl = 300

record {
value = azurerm_linux_web_app.tenttiarkisto.custom_domain_verification_id
}
}

resource "azurerm_dns_txt_record" "tenttiarkisto_www_txt_asuid" {
name = "asuid.www"
resource_group_name = var.tikweb_app_plan_rg_name
zone_name = azurerm_dns_zone.tenttiarkisto_zone.name
ttl = 300

Expand All @@ -130,7 +141,7 @@ resource "azurerm_dns_txt_record" "tenttiarkisto_txt_asuid" {
}

resource "azurerm_app_service_custom_hostname_binding" "tenttiarkisto_hostname_binding" {
resource_group_name = azurerm_resource_group.tenttiarkisto_rg.name
resource_group_name = var.tikweb_app_plan_rg_name
app_service_name = azurerm_linux_web_app.tenttiarkisto.name
hostname = "tenttiarkisto.fi"

Expand All @@ -139,7 +150,7 @@ resource "azurerm_app_service_custom_hostname_binding" "tenttiarkisto_hostname_b
}

depends_on = [
azurerm_dns_txt_record.tenttiarkisto_txt_asuid
azurerm_dns_txt_record.tenttiarkisto_txt_asuid,
]
}

Expand All @@ -154,7 +165,7 @@ resource "azurerm_app_service_certificate_binding" "tenttiarkisto_cert_binding"
}

resource "azurerm_app_service_custom_hostname_binding" "tenttiarkisto_www_hostname_binding" {
resource_group_name = azurerm_resource_group.tenttiarkisto_rg.name
resource_group_name = var.tikweb_app_plan_rg_name
app_service_name = azurerm_linux_web_app.tenttiarkisto.name
hostname = "www.tenttiarkisto.fi"

Expand All @@ -163,7 +174,8 @@ resource "azurerm_app_service_custom_hostname_binding" "tenttiarkisto_www_hostna
}

depends_on = [
azurerm_dns_cname_record.tenttiarkisto_cname_www
azurerm_dns_cname_record.tenttiarkisto_cname_www,
azurerm_dns_txt_record.tenttiarkisto_www_txt_asuid
]
}

Expand Down

0 comments on commit 2c85734

Please sign in to comment.