Compare commits

..

2 Commits

Author SHA1 Message Date
023de7e88d Formatting corrections. 2025-08-19 07:25:51 +02:00
a240e62e75 Added addition environment variable. 2025-08-19 07:25:41 +02:00

View File

@@ -30,7 +30,7 @@ data "azuread_user" "az_lab_admin" {
locals { locals {
kv_secret_name = "azure-client-secret" kv_secret_name = "azure-client-secret"
app_name = "${var.project_name}-app" app_name = "${var.project_name}-app"
} }
resource "azurerm_resource_group" "rg" { resource "azurerm_resource_group" "rg" {
@@ -120,6 +120,11 @@ resource "azurerm_container_app" "app" {
name = "AZURE_SUBSCRIPTION_ID" name = "AZURE_SUBSCRIPTION_ID"
value = var.subscription_id value = var.subscription_id
} }
env {
name = "AZURE_LOCATION"
value = azurerm_resource_group.rg.location
}
} }
} }
@@ -184,19 +189,19 @@ resource "azurerm_dns_txt_record" "domain_verification" {
} }
resource "azurerm_dns_cname_record" "app_record" { resource "azurerm_dns_cname_record" "app_record" {
name = var.project_name name = var.project_name
zone_name = var.dns_zone_name zone_name = var.dns_zone_name
resource_group_name = var.dns_zone_resource_group_name resource_group_name = var.dns_zone_resource_group_name
ttl = 300 ttl = 300
record = "${local.app_name}.${azurerm_container_app_environment.env.default_domain}" record = "${local.app_name}.${azurerm_container_app_environment.env.default_domain}"
} }
resource "azurerm_container_app_custom_domain" "custom_domain" { resource "azurerm_container_app_custom_domain" "custom_domain" {
name = trimsuffix(trimprefix(azurerm_dns_txt_record.domain_verification.fqdn, "asuid."), ".") name = trimsuffix(trimprefix(azurerm_dns_txt_record.domain_verification.fqdn, "asuid."), ".")
container_app_id = azurerm_container_app.app.id container_app_id = azurerm_container_app.app.id
lifecycle { lifecycle {
ignore_changes = [ certificate_binding_type, container_app_environment_certificate_id ] ignore_changes = [certificate_binding_type, container_app_environment_certificate_id]
} }
} }