Skip to content

Commit

Permalink
[CES-477] Create Private DNS Zone for KeyVaults (#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty93 authored Nov 6, 2024
1 parent 50a599a commit 55cf892
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/_modules/global/modules/dns/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ output "external_domain" {

output "dns_default_ttl_sec" {
value = var.dns_default_ttl_sec
}
}
13 changes: 12 additions & 1 deletion src/common/_modules/global/modules/dns/private_dns_zone_links.tf
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@ resource "azurerm_private_dns_zone_virtual_network_link" "srch_private_vnet_comm
tags = var.tags
}

resource "azurerm_private_dns_zone_virtual_network_link" "vault_private_vnet_common" {
for_each = { for name, vnet in var.vnets : name => vnet if contains(["weu", "itn"], name) }
name = each.value.name
resource_group_name = var.resource_groups.common
private_dns_zone_name = azurerm_private_dns_zone.privatelink_vault.name
virtual_network_id = each.value.id
registration_enabled = false

tags = var.tags
}

resource "azurerm_private_dns_zone_virtual_network_link" "azure_api_net_vnet_common" {
for_each = { for name, vnet in var.vnets : name => vnet if contains(["weu", "itn"], name) }
name = each.value.name
Expand Down Expand Up @@ -184,4 +195,4 @@ resource "azurerm_private_dns_zone_virtual_network_link" "scm_azure_api_net_vnet
registration_enabled = false

tags = var.tags
}
}
7 changes: 6 additions & 1 deletion src/common/_modules/global/modules/dns/private_dns_zones.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ resource "azurerm_private_dns_zone" "privatelink_srch" {
resource_group_name = var.resource_groups.common
}

resource "azurerm_private_dns_zone" "privatelink_vault" {
name = "privatelink.vaultcore.azure.net"
resource_group_name = var.resource_groups.common
}

resource "azurerm_private_dns_zone" "azure_api_net" {
name = "azure-api.net"
resource_group_name = var.resource_groups.common
Expand All @@ -125,4 +130,4 @@ resource "azurerm_private_dns_zone" "scm_azure_api_net" {
resource_group_name = var.resource_groups.common

tags = var.tags
}
}

0 comments on commit 55cf892

Please sign in to comment.