Skip to content

Commit

Permalink
add dns private for ca onboarding ms
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf committed Nov 7, 2023
1 parent 8314fd5 commit ae4b12b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .container_apps/onboarding-ms/container_app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,20 @@ resource "azurerm_key_vault_access_policy" "keyvault_containerapp_access_policy"
"Get",
]
}

data "azurerm_resource_group" "rg_vnet" {
name = format("%s-vnet-rg", local.project)
}

data "azurerm_private_dns_zone" "private_azurecontainerapps_io" {
name = local.container_app_environment_dns_zone_name
resource_group_name = data.azurerm_resource_group.rg_vnet.name
}

resource "azurerm_private_dns_a_record" "private_dns_record_a_azurecontainerapps_io" {
name = "${azapi_resource.container_app_onboarding_ms.name}.${trimsuffix(data.azurerm_container_app_environment.container_app_environment.default_domain, ".${local.container_app_environment_dns_zone_name}")}"
zone_name = data.azurerm_private_dns_zone.private_azurecontainerapps_io.name
resource_group_name = data.azurerm_resource_group.rg_vnet.name
ttl = 3600
records = [data.azurerm_container_app_environment.container_app_environment.static_ip_address]
}
2 changes: 2 additions & 0 deletions .container_apps/onboarding-ms/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ locals {
project = "${var.prefix}-${var.env_short}"
app_name = "onboarding-ms"

container_app_environment_dns_zone_name = "azurecontainerapps.io"

secrets = [for secret in var.key_vault.secrets_names :
{
identity = "system"
Expand Down

0 comments on commit ae4b12b

Please sign in to comment.