From fd941af503dea65da4e263bd15a0c95b66ddcbf4 Mon Sep 17 00:00:00 2001 From: Vedant Kalia Date: Tue, 11 Mar 2025 20:52:24 +0530 Subject: [PATCH 1/2] Fix:Private Endpoint Naming --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 3f0cad5..973d9a3 100644 --- a/main.tf +++ b/main.tf @@ -323,7 +323,7 @@ data "azurerm_virtual_network" "vnet01" { resource "azurerm_private_endpoint" "pep1" { count = var.enable_private_endpoint ? 1 : 0 - name = "sqldb-private-endpoint" + name = format("%s", "sqldb-private-endpoint") location = local.location resource_group_name = local.resource_group_name subnet_id = var.existing_subnet_id From 09417ae57ed827ba439d94fda9a35a43c4a4156d Mon Sep 17 00:00:00 2001 From: Vedant Kalia Date: Tue, 11 Mar 2025 21:13:14 +0530 Subject: [PATCH 2/2] Fix:Private Endpoint Naming --- main.tf | 4 ++-- variables.tf | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 973d9a3..ef40fd0 100644 --- a/main.tf +++ b/main.tf @@ -323,7 +323,7 @@ data "azurerm_virtual_network" "vnet01" { resource "azurerm_private_endpoint" "pep1" { count = var.enable_private_endpoint ? 1 : 0 - name = format("%s", "sqldb-private-endpoint") + name = var.endpoint_name == "" ? format("%s", "sqldb-private-endpoint") : var.endpoint_name location = local.location resource_group_name = local.resource_group_name subnet_id = var.existing_subnet_id @@ -380,7 +380,7 @@ resource "azurerm_private_dns_zone" "dnszone1" { resource "azurerm_private_dns_zone_virtual_network_link" "vent-link1" { count = var.enable_private_endpoint ? 1 : 0 - name = "vnet-private-zone-link" + name = var.vnet_link_name == "" ? "vnet-private-zone-link" : var.vnet_link_name resource_group_name = local.resource_group_name private_dns_zone_name = var.existing_private_dns_zone == null ? azurerm_private_dns_zone.dnszone1[0].name : var.existing_private_dns_zone virtual_network_id = var.existing_vnet_id == null ? data.azurerm_virtual_network.vnet01[0].id : var.existing_vnet_id diff --git a/variables.tf b/variables.tf index e2ec0a6..51a3c8a 100644 --- a/variables.tf +++ b/variables.tf @@ -342,4 +342,17 @@ variable "db_sku_name" { variable "enclave_type" { type = string default = "VBS" +} + +variable "endpoint_name" { + type = string + default = "" + description = "Custom Name for the Private Endpoint" +} + +variable "vnet_link_name" { + type = string + default = "" + description = "Custom Name for the Private Endpoint" + } \ No newline at end of file