From 834e624c740a84249c6066a55135145b9536c2dd Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Wed, 13 Aug 2025 23:40:45 +0530 Subject: [PATCH 01/27] updated files --- locals.tf | 29 +++++++++++++++++++++++++++++ main.tf | 22 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 locals.tf diff --git a/locals.tf b/locals.tf new file mode 100644 index 0000000..a076bee --- /dev/null +++ b/locals.tf @@ -0,0 +1,29 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +locals { + resource_group_name = module.resource_names["resource_group"].standard + endpoint_name = module.resource_names["private_endpoint"].standard + private_service_connection_name = module.resource_names["private_service_connection"].standard + + default_tags = { + "provisioner" = "terraform" + } + + resource_group_tags = merge({ resource_name = local.resource_group_name }, local.default_tags, var.tags) + private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) + + resource_group = { + name = local.resource_group_name + location = var.location + } +} \ No newline at end of file diff --git a/main.tf b/main.tf index c4fd1fb..7d0905a 100644 --- a/main.tf +++ b/main.tf @@ -101,3 +101,25 @@ module "postgresql_server_ad_administrator" { principal_name = var.ad_administrator.principal_name principal_type = var.ad_administrator.principal_type } + +module "private_endpoint" { + source = "terraform.registry.launch.nttdata.com/module_primitive/private_endpoint/azurerm" + version = "~> 1.0" + + count = var.public_network_access_enabled ? 0 : 1 + + endpoint_name = local.endpoint_name + resource_group_name = local.resource_group_name + region = var.location + subnet_id = var.subnet_id + private_dns_zone_group_name = var.private_dns_zone_group_name + private_dns_zone_ids = var.private_dns_zone_ids + is_manual_connection = var.is_manual_connection + private_connection_resource_id = module.postgresql_server.postgresql_server_id + subresource_names = var.subresource_names + request_message = var.request_message + tags = local.private_endpoint_tags + private_service_connection_name = local.private_service_connection_name + + depends_on = [module.postgresql_server] +} \ No newline at end of file From 08ad2a08b518e3047ee85287c85711f4a39320f0 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 00:31:42 +0530 Subject: [PATCH 02/27] updated files --- variables.tf | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/variables.tf b/variables.tf index e3d4e69..de54214 100644 --- a/variables.tf +++ b/variables.tf @@ -340,3 +340,52 @@ variable "tags" { type = map(string) default = {} } + +variable "request_message" { + description = < Date: Thu, 14 Aug 2025 00:56:08 +0530 Subject: [PATCH 03/27] updated files --- main.tf | 2 +- outputs.tf | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 7d0905a..ef0d037 100644 --- a/main.tf +++ b/main.tf @@ -44,7 +44,7 @@ module "postgresql_server" { name = module.resource_names["postgresql_server"].standard resource_group_name = module.resource_group.name location = var.location - + create_mode = var.create_mode postgres_version = var.postgres_version sku_name = var.sku_name diff --git a/outputs.tf b/outputs.tf index e6f29c9..0644498 100644 --- a/outputs.tf +++ b/outputs.tf @@ -53,3 +53,7 @@ output "source_server_id" { output "server_configuration" { value = { for config in module.postgresql_server_configuration : config.name => config.value } } +output "postgresql_server_id" { + description = "ID of the PostgreSQL Server" + value = module.postgresql_server.postgresql_server_id +} \ No newline at end of file From e3d7a4423c99f3d3ecef7fb488a2441fe9e9bf60 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 01:03:49 +0530 Subject: [PATCH 04/27] updated files --- main.tf | 2 +- outputs.tf | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index ef0d037..941fdd7 100644 --- a/main.tf +++ b/main.tf @@ -115,7 +115,7 @@ module "private_endpoint" { private_dns_zone_group_name = var.private_dns_zone_group_name private_dns_zone_ids = var.private_dns_zone_ids is_manual_connection = var.is_manual_connection - private_connection_resource_id = module.postgresql_server.postgresql_server_id + private_connection_resource_id = module.postgresql_server.id subresource_names = var.subresource_names request_message = var.request_message tags = local.private_endpoint_tags diff --git a/outputs.tf b/outputs.tf index 0644498..fe47d49 100644 --- a/outputs.tf +++ b/outputs.tf @@ -55,5 +55,9 @@ output "server_configuration" { } output "postgresql_server_id" { description = "ID of the PostgreSQL Server" - value = module.postgresql_server.postgresql_server_id -} \ No newline at end of file + value = module.postgresql_server.id +} +output "private_endpoint_id" { + description = "ID of the Private Endpoint" + value = try(module.private_endpoint[0].id, "") +} From aa8af35744a02d2dbde83d9bad34eb1a77173366 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 01:10:00 +0530 Subject: [PATCH 05/27] files updated --- outputs.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/outputs.tf b/outputs.tf index fe47d49..c937b81 100644 --- a/outputs.tf +++ b/outputs.tf @@ -57,7 +57,7 @@ output "postgresql_server_id" { description = "ID of the PostgreSQL Server" value = module.postgresql_server.id } -output "private_endpoint_id" { - description = "ID of the Private Endpoint" - value = try(module.private_endpoint[0].id, "") -} +# output "private_endpoint_id" { +# description = "ID of the Private Endpoint" +# value = try(module.private_endpoint[0].id, "") +# } From d3795d45f56dde54becf8379f5c86e25424e1775 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 11:34:50 +0530 Subject: [PATCH 06/27] updated locals.tf files --- locals.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locals.tf b/locals.tf index a076bee..92a6b24 100644 --- a/locals.tf +++ b/locals.tf @@ -12,8 +12,8 @@ locals { resource_group_name = module.resource_names["resource_group"].standard - endpoint_name = module.resource_names["private_endpoint"].standard - private_service_connection_name = module.resource_names["private_service_connection"].standard + endpoint_name = "psql-endpoint" + private_service_connection_name = "psql-service-connection" default_tags = { "provisioner" = "terraform" From c0a1034692570d03504c2697a75f9400b65b8803 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 13:03:05 +0530 Subject: [PATCH 07/27] updated files --- outputs.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/outputs.tf b/outputs.tf index c937b81..fe47d49 100644 --- a/outputs.tf +++ b/outputs.tf @@ -57,7 +57,7 @@ output "postgresql_server_id" { description = "ID of the PostgreSQL Server" value = module.postgresql_server.id } -# output "private_endpoint_id" { -# description = "ID of the Private Endpoint" -# value = try(module.private_endpoint[0].id, "") -# } +output "private_endpoint_id" { + description = "ID of the Private Endpoint" + value = try(module.private_endpoint[0].id, "") +} From 04266102b488e8ab4ac583f3f9c1e68d79eccd28 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 13:08:35 +0530 Subject: [PATCH 08/27] updates files --- variables.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/variables.tf b/variables.tf index de54214..a8f930c 100644 --- a/variables.tf +++ b/variables.tf @@ -368,8 +368,7 @@ variable "private_dns_zone_group_name" { variable "private_dns_zone_ids" { description = "A list of Private DNS Zone IDs to link with the Private Endpoint." - type = list(string) - default = [] + type = string } variable "is_manual_connection" { From f7c464ba0b6b94eca4b02bd84010c73e4b14505d Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 17:59:16 +0530 Subject: [PATCH 09/27] uopdated file --- variables.tf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/variables.tf b/variables.tf index a8f930c..da5b615 100644 --- a/variables.tf +++ b/variables.tf @@ -367,10 +367,11 @@ variable "private_dns_zone_group_name" { } variable "private_dns_zone_ids" { - description = "A list of Private DNS Zone IDs to link with the Private Endpoint." - type = string + type = list(string) + default = [] } + variable "is_manual_connection" { description = < Date: Thu, 14 Aug 2025 19:21:45 +0530 Subject: [PATCH 10/27] updated files --- main.tf | 16 +++++++++++++++- variables.tf | 6 ++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 941fdd7..b0bb3bb 100644 --- a/main.tf +++ b/main.tf @@ -113,7 +113,7 @@ module "private_endpoint" { region = var.location subnet_id = var.subnet_id private_dns_zone_group_name = var.private_dns_zone_group_name - private_dns_zone_ids = var.private_dns_zone_ids + private_dns_zone_ids = var.private_dns_zone_suffixes is_manual_connection = var.is_manual_connection private_connection_resource_id = module.postgresql_server.id subresource_names = var.subresource_names @@ -122,4 +122,18 @@ module "private_endpoint" { private_service_connection_name = local.private_service_connection_name depends_on = [module.postgresql_server] +} + +module "private_dns_zones" { + source = "terraform.registry.launch.nttdata.com/module_primitive/private_dns_zone/azurerm" + version = "~> 1.0" + + for_each = var.private_dns_zone_suffixes + + zone_name = each.key + resource_group_name = module.resource_group.name + + tags = local.tags + + depends_on = [module.resource_group] } \ No newline at end of file diff --git a/variables.tf b/variables.tf index da5b615..038a9a6 100644 --- a/variables.tf +++ b/variables.tf @@ -389,3 +389,9 @@ variable "subresource_names" { type = list(string) default = ["psql"] } + +variable "private_dns_zone_suffixes" { + description = "A set of private DNS zones to create" + type = set(string) + default = [] +} \ No newline at end of file From bdde02aa70fa4b5afa8fa63493afd231500b88ba Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 19:54:01 +0530 Subject: [PATCH 11/27] updated main.tf --- main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index b0bb3bb..5b4cfea 100644 --- a/main.tf +++ b/main.tf @@ -133,7 +133,8 @@ module "private_dns_zones" { zone_name = each.key resource_group_name = module.resource_group.name - tags = local.tags + tags = var.tags + depends_on = [module.resource_group] } \ No newline at end of file From b8a819bcf6e2dcf04e5d904f0c246496d33f6ddf Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Thu, 14 Aug 2025 21:27:33 +0530 Subject: [PATCH 12/27] updated files --- main.tf | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 5b4cfea..058742d 100644 --- a/main.tf +++ b/main.tf @@ -58,7 +58,7 @@ module "postgresql_server" { administrator_password = var.administrator_password delegated_subnet_id = var.delegated_subnet_id - private_dns_zone_id = var.private_dns_zone_id + private_dns_zone_id = var.postgres_private_dns_zone_id public_network_access_enabled = var.public_network_access_enabled high_availability = var.high_availability @@ -137,4 +137,46 @@ module "private_dns_zones" { depends_on = [module.resource_group] +} + +variable "enable_private_endpoint" { + description = "Enable private endpoint for PostgreSQL server" + type = bool + default = false +} + +variable "private_endpoint_subnet_id" { + description = "Subnet ID for private endpoint" + type = string + default = "" +} + +variable "postgres_private_dns_zone_id" { + description = "ID of the private DNS zone for PostgreSQL" + type = string + default = "" +} + +resource "azurerm_private_endpoint" "postgresql" { + count = var.enable_private_endpoint ? 1 : 0 + name = "${module.resource_names["postgresql_server"].standard}-pe" + location = var.location + resource_group_name = module.resource_group.name + subnet_id = var.private_endpoint_subnet_id + + private_service_connection { + name = "${module.resource_names["postgresql_server"].standard}-psc" + private_connection_resource_id = module.postgresql_server.id + subresource_names = ["postgresqlServer"] + is_manual_connection = false + } + + private_dns_zone_group { + name = "default" + private_dns_zone_ids = [var.postgres_private_dns_zone_id] + } + + tags = var.tags + + depends_on = [module.postgresql_server] } \ No newline at end of file From 24b23a02f1e6f9b2a08a047837a1b4f62feb1b99 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Fri, 15 Aug 2025 00:05:12 +0530 Subject: [PATCH 13/27] updated file --- locals.tf | 26 +++++++++++++++----------- main.tf | 40 +++++++++++++++++++++++++++------------- outputs.tf | 30 ++++++++++++++++-------------- variables.tf | 51 ++++++++++++++++++++++++++++++++++----------------- 4 files changed, 92 insertions(+), 55 deletions(-) diff --git a/locals.tf b/locals.tf index 92a6b24..809d6d4 100644 --- a/locals.tf +++ b/locals.tf @@ -1,25 +1,29 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Local values for resource names and tags locals { resource_group_name = module.resource_names["resource_group"].standard endpoint_name = "psql-endpoint" private_service_connection_name = "psql-service-connection" + # Default tags applied to all resources default_tags = { "provisioner" = "terraform" } + # Tags for resource group (resource_name, default_tags, user tags) resource_group_tags = merge({ resource_name = local.resource_group_name }, local.default_tags, var.tags) + # Tags for private endpoint (resource_name, default_tags, user tags) private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) resource_group = { diff --git a/main.tf b/main.tf index 058742d..8a40ee2 100644 --- a/main.tf +++ b/main.tf @@ -1,14 +1,14 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. module "resource_names" { source = "terraform.registry.launch.nttdata.com/module_library/resource_name/launch" @@ -146,9 +146,13 @@ variable "enable_private_endpoint" { } variable "private_endpoint_subnet_id" { - description = "Subnet ID for private endpoint" + description = "Subnet ID for the private endpoint" type = string default = "" + validation { + condition = length(var.private_endpoint_subnet_id) > 0 + error_message = "private_endpoint_subnet_id must be provided when enable_private_endpoint is true." + } } variable "postgres_private_dns_zone_id" { @@ -157,6 +161,16 @@ variable "postgres_private_dns_zone_id" { default = "" } +variable "private_dns_zone_ids" { + description = "List of private DNS zone IDs for PostgreSQL" + type = list(string) + default = [] + validation { + condition = var.enable_private_endpoint ? length(var.private_dns_zone_ids) > 0 : true + error_message = "private_dns_zone_ids must be provided when enable_private_endpoint is true." + } +} + resource "azurerm_private_endpoint" "postgresql" { count = var.enable_private_endpoint ? 1 : 0 name = "${module.resource_names["postgresql_server"].standard}-pe" @@ -173,7 +187,7 @@ resource "azurerm_private_endpoint" "postgresql" { private_dns_zone_group { name = "default" - private_dns_zone_ids = [var.postgres_private_dns_zone_id] + private_dns_zone_ids = var.private_dns_zone_ids } tags = var.tags diff --git a/outputs.tf b/outputs.tf index fe47d49..445ed03 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,14 +1,14 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. output "id" { value = module.postgresql_server.id @@ -39,11 +39,13 @@ output "admin_principal_name" { } output "delegated_subnet_id" { - value = module.postgresql_server.delegated_subnet_id + description = "ID of the delegated subnet for the PostgreSQL server" + value = module.postgresql_server.delegated_subnet_id } output "private_dns_zone_id" { - value = module.postgresql_server.private_dns_zone_id + description = "ID of the private DNS zone associated with the PostgreSQL server" + value = module.postgresql_server.private_dns_zone_id } output "source_server_id" { @@ -58,6 +60,6 @@ output "postgresql_server_id" { value = module.postgresql_server.id } output "private_endpoint_id" { - description = "ID of the Private Endpoint" + description = "ID of the Private Endpoint (empty if not created)" value = try(module.private_endpoint[0].id, "") } diff --git a/variables.tf b/variables.tf index 038a9a6..4e564f5 100644 --- a/variables.tf +++ b/variables.tf @@ -1,14 +1,14 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. variable "resource_names_map" { description = "A map of key to resource_name that will be used by tf-launch-module_library-resource_name to generate resource names" @@ -366,11 +366,34 @@ variable "private_dns_zone_group_name" { default = "psql" } +# Used for private endpoint resource creation +variable "private_endpoint_subnet_id" { + description = "Subnet ID for the private endpoint. Used only when enable_private_endpoint is true." + type = string + default = "" + validation { + condition = var.enable_private_endpoint ? length(var.private_endpoint_subnet_id) > 0 : true + error_message = "private_endpoint_subnet_id must be provided when enable_private_endpoint is true." + } +} + +# Used for private endpoint DNS zone group variable "private_dns_zone_ids" { + description = "List of private DNS zone IDs for PostgreSQL. Used only when enable_private_endpoint is true." type = list(string) default = [] + validation { + condition = var.enable_private_endpoint ? length(var.private_dns_zone_ids) > 0 : true + error_message = "private_dns_zone_ids must be provided when enable_private_endpoint is true." + } } +# Used for module-based DNS zone creation +variable "private_dns_zone_suffixes" { + description = "A set of private DNS zones to create (used for DNS zone module, not for private endpoint resource)." + type = set(string) + default = [] +} variable "is_manual_connection" { description = < Date: Sun, 17 Aug 2025 20:18:40 +0530 Subject: [PATCH 14/27] updated files --- main.tf | 12 ++++++------ variables.tf | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index 8a40ee2..a7f4e35 100644 --- a/main.tf +++ b/main.tf @@ -173,21 +173,21 @@ variable "private_dns_zone_ids" { resource "azurerm_private_endpoint" "postgresql" { count = var.enable_private_endpoint ? 1 : 0 - name = "${module.resource_names["postgresql_server"].standard}-pe" + name = "${var.name}-pe" location = var.location resource_group_name = module.resource_group.name - subnet_id = var.private_endpoint_subnet_id + subnet_id = var.subnet_id private_service_connection { - name = "${module.resource_names["postgresql_server"].standard}-psc" - private_connection_resource_id = module.postgresql_server.id + name = "${var.name}-psc" + private_connection_resource_id = mazurerm_postgresql_flexible_server.postgres.id subresource_names = ["postgresqlServer"] is_manual_connection = false } private_dns_zone_group { - name = "default" - private_dns_zone_ids = var.private_dns_zone_ids + name = "dpostgresql-dns-zone-group" + private_dns_zone_ids = [var.private_dns_zone_id] } tags = var.tags diff --git a/variables.tf b/variables.tf index 4e564f5..6077e01 100644 --- a/variables.tf +++ b/variables.tf @@ -147,6 +147,11 @@ variable "delegated_subnet_id" { default = null } +variable "private_endpoint_enabled" { + type = bool + default = false +} + variable "private_dns_zone_id" { description = "The ID of the private DNS zone. Required when `delegated_subnet_id` is set" type = string From 632fe3369a99b3f1e2c438eb314989a946ea9862 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Sun, 17 Aug 2025 23:10:55 +0530 Subject: [PATCH 15/27] updated files --- main.tf | 18 +++++++++--------- variables.tf | 12 +++++++++++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/main.tf b/main.tf index a7f4e35..78082ba 100644 --- a/main.tf +++ b/main.tf @@ -171,23 +171,23 @@ variable "private_dns_zone_ids" { } } -resource "azurerm_private_endpoint" "postgresql" { +resource "azurerm_private_endpoint" "postgres" { count = var.enable_private_endpoint ? 1 : 0 - name = "${var.name}-pe" - location = var.location - resource_group_name = module.resource_group.name - subnet_id = var.subnet_id + name = "${local.prefix}-postgres-pe" + location = azurerm_postgresql_flexible_server.this.location + resource_group_name = azurerm_postgresql_flexible_server.this.resource_group_name + subnet_id = module.network.subnets["private-endpoint-subnet"].id private_service_connection { - name = "${var.name}-psc" - private_connection_resource_id = mazurerm_postgresql_flexible_server.postgres.id + name = "${local.prefix}-postgres-privatesc" + private_connection_resource_id = azurerm_postgresql_flexible_server.this.id subresource_names = ["postgresqlServer"] is_manual_connection = false } private_dns_zone_group { - name = "dpostgresql-dns-zone-group" - private_dns_zone_ids = [var.private_dns_zone_id] + name = "postgres-dns-group" + private_dns_zone_ids = [var.postgres_private_dns_zone_id] } tags = var.tags diff --git a/variables.tf b/variables.tf index 6077e01..7e57022 100644 --- a/variables.tf +++ b/variables.tf @@ -416,4 +416,14 @@ variable "subresource_names" { EOT type = list(string) default = ["psql"] -} \ No newline at end of file +} + +variable "enable_private_endpoint" { + type = bool + default = false +} + +variable "postgres_private_dns_zone_id" { + type = string + description = "Private DNS Zone ID for Postgres from sharedsvc-network" +} From 48729acfd1b38fa06f22a4183d23bbea41592c8f Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Mon, 18 Aug 2025 01:30:32 +0530 Subject: [PATCH 16/27] updated files --- main.tf | 16 ++++++++-------- variables.tf | 14 ++++++++++---- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/main.tf b/main.tf index 78082ba..905d803 100644 --- a/main.tf +++ b/main.tf @@ -173,24 +173,24 @@ variable "private_dns_zone_ids" { resource "azurerm_private_endpoint" "postgres" { count = var.enable_private_endpoint ? 1 : 0 - name = "${local.prefix}-postgres-pe" - location = azurerm_postgresql_flexible_server.this.location - resource_group_name = azurerm_postgresql_flexible_server.this.resource_group_name - subnet_id = module.network.subnets["private-endpoint-subnet"].id + name = "${module.resource_names["postgresql_server"].standard}-pe" + location = module.resource_group.location + resource_group_name = module.resource_group.name + subnet_id = var.private_endpoint_subnet_id private_service_connection { - name = "${local.prefix}-postgres-privatesc" - private_connection_resource_id = azurerm_postgresql_flexible_server.this.id + name = "${module.resource_names["postgresql_server"].standard}-psc" + private_connection_resource_id = module.postgresql_server.id subresource_names = ["postgresqlServer"] is_manual_connection = false } private_dns_zone_group { name = "postgres-dns-group" - private_dns_zone_ids = [var.postgres_private_dns_zone_id] + private_dns_zone_ids = var.private_dns_zone_ids } tags = var.tags depends_on = [module.postgresql_server] -} \ No newline at end of file +} diff --git a/variables.tf b/variables.tf index 7e57022..872d042 100644 --- a/variables.tf +++ b/variables.tf @@ -373,7 +373,7 @@ variable "private_dns_zone_group_name" { # Used for private endpoint resource creation variable "private_endpoint_subnet_id" { - description = "Subnet ID for the private endpoint. Used only when enable_private_endpoint is true." + description = "Subnet ID for the private endpoint" type = string default = "" validation { @@ -423,7 +423,13 @@ variable "enable_private_endpoint" { default = false } -variable "postgres_private_dns_zone_id" { - type = string - description = "Private DNS Zone ID for Postgres from sharedsvc-network" +variable "private_dns_zone_ids" { + description = "List of private DNS zone IDs for PostgreSQL (used by private endpoint)" + type = list(string) + default = [] + validation { + condition = var.enable_private_endpoint ? length(var.private_dns_zone_ids) > 0 : true + error_message = "private_dns_zone_ids must be provided when enable_private_endpoint is true." + } } + From 0cdcbfffac7ee8736822ad95b369882a5b94b081 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Mon, 18 Aug 2025 05:25:44 +0530 Subject: [PATCH 17/27] updated files --- locals.tf | 1 + main.tf | 10 ++++++++++ variables.tf | 10 ++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/locals.tf b/locals.tf index 809d6d4..b6a7109 100644 --- a/locals.tf +++ b/locals.tf @@ -15,6 +15,7 @@ locals { resource_group_name = module.resource_names["resource_group"].standard endpoint_name = "psql-endpoint" private_service_connection_name = "psql-service-connection" + subresource_names = ["postgresqlServer"] # Default tags applied to all resources default_tags = { diff --git a/main.tf b/main.tf index 905d803..8001d5b 100644 --- a/main.tf +++ b/main.tf @@ -194,3 +194,13 @@ resource "azurerm_private_endpoint" "postgres" { depends_on = [module.postgresql_server] } + +resource "azurerm_private_dns_zone_group" "postgres" { + name = var.dns_zone_group_name + private_endpoint_id = azurerm_private_endpoint.postgres.id + + private_dns_zone_configs { + name = "postgresql" + private_dns_zone_id = var.private_dns_zone_id + } +} diff --git a/variables.tf b/variables.tf index 872d042..031cad0 100644 --- a/variables.tf +++ b/variables.tf @@ -371,6 +371,13 @@ variable "private_dns_zone_group_name" { default = "psql" } +variable "dns_zone_group_name" { type = string, default = "postgresql" } + +variable "endpoint_name" { type = string, default = "pe-postgresql" } + +variable "psc_name" { type = string, default = "psc-postgresql" } +variable "postgres_server_id" { type = string } + # Used for private endpoint resource creation variable "private_endpoint_subnet_id" { description = "Subnet ID for the private endpoint" @@ -431,5 +438,4 @@ variable "private_dns_zone_ids" { condition = var.enable_private_endpoint ? length(var.private_dns_zone_ids) > 0 : true error_message = "private_dns_zone_ids must be provided when enable_private_endpoint is true." } -} - +} \ No newline at end of file From 51045c3acb92b8e928d39a9617c205eb029088f4 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Mon, 18 Aug 2025 14:44:30 +0530 Subject: [PATCH 18/27] updated files --- locals.tf | 25 +++----- main.tf | 116 ++++++----------------------------- outputs.tf | 38 +++++------- variables.tf | 167 ++++++++++++++++++--------------------------------- 4 files changed, 100 insertions(+), 246 deletions(-) diff --git a/locals.tf b/locals.tf index b6a7109..3157556 100644 --- a/locals.tf +++ b/locals.tf @@ -13,22 +13,15 @@ # Local values for resource names and tags locals { resource_group_name = module.resource_names["resource_group"].standard - endpoint_name = "psql-endpoint" - private_service_connection_name = "psql-service-connection" - subresource_names = ["postgresqlServer"] - - # Default tags applied to all resources - default_tags = { + endpoint_name = module.resource_names["private_endpoint"].standard + private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) + private_service_connection_name = module.resource_names["private_service_connection"].standard + + default_tags = { "provisioner" = "terraform" } - - # Tags for resource group (resource_name, default_tags, user tags) - resource_group_tags = merge({ resource_name = local.resource_group_name }, local.default_tags, var.tags) - # Tags for private endpoint (resource_name, default_tags, user tags) - private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) - resource_group = { - name = local.resource_group_name - location = var.location - } -} \ No newline at end of file + # subresource_names = ["postgresqlServer"] +} + + \ No newline at end of file diff --git a/main.tf b/main.tf index 8001d5b..b78ded7 100644 --- a/main.tf +++ b/main.tf @@ -1,14 +1,15 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. module "resource_names" { source = "terraform.registry.launch.nttdata.com/module_library/resource_name/launch" @@ -44,7 +45,7 @@ module "postgresql_server" { name = module.resource_names["postgresql_server"].standard resource_group_name = module.resource_group.name location = var.location - + create_mode = var.create_mode postgres_version = var.postgres_version sku_name = var.sku_name @@ -58,7 +59,7 @@ module "postgresql_server" { administrator_password = var.administrator_password delegated_subnet_id = var.delegated_subnet_id - private_dns_zone_id = var.postgres_private_dns_zone_id + private_dns_zone_id = var.private_dns_zone_id public_network_access_enabled = var.public_network_access_enabled high_availability = var.high_availability @@ -113,94 +114,13 @@ module "private_endpoint" { region = var.location subnet_id = var.subnet_id private_dns_zone_group_name = var.private_dns_zone_group_name - private_dns_zone_ids = var.private_dns_zone_suffixes + private_dns_zone_ids = var.private_dns_zone_ids is_manual_connection = var.is_manual_connection - private_connection_resource_id = module.postgresql_server.id + # private_connection_resource_id = var.key_vault_id subresource_names = var.subresource_names request_message = var.request_message tags = local.private_endpoint_tags private_service_connection_name = local.private_service_connection_name - depends_on = [module.postgresql_server] -} - -module "private_dns_zones" { - source = "terraform.registry.launch.nttdata.com/module_primitive/private_dns_zone/azurerm" - version = "~> 1.0" - - for_each = var.private_dns_zone_suffixes - - zone_name = each.key - resource_group_name = module.resource_group.name - - tags = var.tags - - - depends_on = [module.resource_group] -} - -variable "enable_private_endpoint" { - description = "Enable private endpoint for PostgreSQL server" - type = bool - default = false -} - -variable "private_endpoint_subnet_id" { - description = "Subnet ID for the private endpoint" - type = string - default = "" - validation { - condition = length(var.private_endpoint_subnet_id) > 0 - error_message = "private_endpoint_subnet_id must be provided when enable_private_endpoint is true." - } -} - -variable "postgres_private_dns_zone_id" { - description = "ID of the private DNS zone for PostgreSQL" - type = string - default = "" -} - -variable "private_dns_zone_ids" { - description = "List of private DNS zone IDs for PostgreSQL" - type = list(string) - default = [] - validation { - condition = var.enable_private_endpoint ? length(var.private_dns_zone_ids) > 0 : true - error_message = "private_dns_zone_ids must be provided when enable_private_endpoint is true." - } -} - -resource "azurerm_private_endpoint" "postgres" { - count = var.enable_private_endpoint ? 1 : 0 - name = "${module.resource_names["postgresql_server"].standard}-pe" - location = module.resource_group.location - resource_group_name = module.resource_group.name - subnet_id = var.private_endpoint_subnet_id - - private_service_connection { - name = "${module.resource_names["postgresql_server"].standard}-psc" - private_connection_resource_id = module.postgresql_server.id - subresource_names = ["postgresqlServer"] - is_manual_connection = false - } - - private_dns_zone_group { - name = "postgres-dns-group" - private_dns_zone_ids = var.private_dns_zone_ids - } - - tags = var.tags - - depends_on = [module.postgresql_server] -} - -resource "azurerm_private_dns_zone_group" "postgres" { - name = var.dns_zone_group_name - private_endpoint_id = azurerm_private_endpoint.postgres.id - - private_dns_zone_configs { - name = "postgresql" - private_dns_zone_id = var.private_dns_zone_id - } -} + # depends_on = [module.postgresql_server] +} \ No newline at end of file diff --git a/outputs.tf b/outputs.tf index 445ed03..175b133 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,14 +1,14 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. output "id" { value = module.postgresql_server.id @@ -39,13 +39,11 @@ output "admin_principal_name" { } output "delegated_subnet_id" { - description = "ID of the delegated subnet for the PostgreSQL server" - value = module.postgresql_server.delegated_subnet_id + value = module.postgresql_server.delegated_subnet_id } output "private_dns_zone_id" { - description = "ID of the private DNS zone associated with the PostgreSQL server" - value = module.postgresql_server.private_dns_zone_id + value = module.postgresql_server.private_dns_zone_id } output "source_server_id" { @@ -54,12 +52,4 @@ output "source_server_id" { output "server_configuration" { value = { for config in module.postgresql_server_configuration : config.name => config.value } -} -output "postgresql_server_id" { - description = "ID of the PostgreSQL Server" - value = module.postgresql_server.id -} -output "private_endpoint_id" { - description = "ID of the Private Endpoint (empty if not created)" - value = try(module.private_endpoint[0].id, "") -} +} \ No newline at end of file diff --git a/variables.tf b/variables.tf index 031cad0..572fc6b 100644 --- a/variables.tf +++ b/variables.tf @@ -1,14 +1,14 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. variable "resource_names_map" { description = "A map of key to resource_name that will be used by tf-launch-module_library-resource_name to generate resource names" @@ -146,10 +146,55 @@ variable "delegated_subnet_id" { type = string default = null } +variable "subnet_id" { + description = < 0 : true - error_message = "private_endpoint_subnet_id must be provided when enable_private_endpoint is true." - } -} - -# Used for private endpoint DNS zone group -variable "private_dns_zone_ids" { - description = "List of private DNS zone IDs for PostgreSQL. Used only when enable_private_endpoint is true." - type = list(string) - default = [] - validation { - condition = var.enable_private_endpoint ? length(var.private_dns_zone_ids) > 0 : true - error_message = "private_dns_zone_ids must be provided when enable_private_endpoint is true." - } -} - -# Used for module-based DNS zone creation -variable "private_dns_zone_suffixes" { - description = "A set of private DNS zones to create (used for DNS zone module, not for private endpoint resource)." - type = set(string) - default = [] -} - -variable "is_manual_connection" { - description = < 0 : true - error_message = "private_dns_zone_ids must be provided when enable_private_endpoint is true." - } } \ No newline at end of file From 2dbfef4472296def8ba270bf8b0daa2e7b20e0c4 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Mon, 18 Aug 2025 16:57:08 +0530 Subject: [PATCH 19/27] updated files --- locals.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locals.tf b/locals.tf index 3157556..d34ffe3 100644 --- a/locals.tf +++ b/locals.tf @@ -21,6 +21,8 @@ locals { "provisioner" = "terraform" } + + # subresource_names = ["postgresqlServer"] } From d4f991d4fc6cdb22bc3a6c720d0d0606d3833ab6 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Mon, 18 Aug 2025 17:29:07 +0530 Subject: [PATCH 20/27] updated files --- locals.tf | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/locals.tf b/locals.tf index d34ffe3..5fa9d25 100644 --- a/locals.tf +++ b/locals.tf @@ -13,17 +13,14 @@ # Local values for resource names and tags locals { resource_group_name = module.resource_names["resource_group"].standard - endpoint_name = module.resource_names["private_endpoint"].standard + endpoint_name = "hygtmp-sandbox-004-neu-postgresql-001" private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) - private_service_connection_name = module.resource_names["private_service_connection"].standard + private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" + default_tags = { "provisioner" = "terraform" } - - - - # subresource_names = ["postgresqlServer"] } \ No newline at end of file From 42af6d184cd01b9db61e93497fe2dd84abc84388 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Mon, 18 Aug 2025 17:30:44 +0530 Subject: [PATCH 21/27] updated files --- locals.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/locals.tf b/locals.tf index 5fa9d25..c2d2106 100644 --- a/locals.tf +++ b/locals.tf @@ -10,14 +10,13 @@ # See the License for the specific language governing permissions and # limitations under the License. + # Local values for resource names and tags locals { resource_group_name = module.resource_names["resource_group"].standard endpoint_name = "hygtmp-sandbox-004-neu-postgresql-001" private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" - - default_tags = { "provisioner" = "terraform" } From 18d578ae9fdef7157b65c8e39bd92ec3a63cba36 Mon Sep 17 00:00:00 2001 From: Raghuramakrishna <340229@nttdata.com> Date: Mon, 18 Aug 2025 17:40:54 +0530 Subject: [PATCH 22/27] updated files --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index b78ded7..6349097 100644 --- a/main.tf +++ b/main.tf @@ -32,7 +32,7 @@ module "resource_group" { source = "terraform.registry.launch.nttdata.com/module_primitive/resource_group/azurerm" version = "~> 1.0" - name = module.resource_names["resource_group"].standard + name = "hygtmp-sandbox-004-neu-postgresql-001-rg" location = var.location tags = merge(var.tags, { resource_name = module.resource_names["resource_group"].standard }) From 20c9b4895a43c8cee5785a4e33335e183cd59087 Mon Sep 17 00:00:00 2001 From: payasam-raghuramakrishna-nttd <340229@nttdata.com> Date: Mon, 18 Aug 2025 19:51:13 +0530 Subject: [PATCH 23/27] Update main.tf Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com> --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 6349097..b78ded7 100644 --- a/main.tf +++ b/main.tf @@ -32,7 +32,7 @@ module "resource_group" { source = "terraform.registry.launch.nttdata.com/module_primitive/resource_group/azurerm" version = "~> 1.0" - name = "hygtmp-sandbox-004-neu-postgresql-001-rg" + name = module.resource_names["resource_group"].standard location = var.location tags = merge(var.tags, { resource_name = module.resource_names["resource_group"].standard }) From 54d52dfd350d208e6936733e03004a39319687d7 Mon Sep 17 00:00:00 2001 From: payasam-raghuramakrishna-nttd <340229@nttdata.com> Date: Mon, 18 Aug 2025 19:51:33 +0530 Subject: [PATCH 24/27] Update main.tf Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com> --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index b78ded7..ae2cd96 100644 --- a/main.tf +++ b/main.tf @@ -116,7 +116,7 @@ module "private_endpoint" { private_dns_zone_group_name = var.private_dns_zone_group_name private_dns_zone_ids = var.private_dns_zone_ids is_manual_connection = var.is_manual_connection - # private_connection_resource_id = var.key_vault_id + private_connection_resource_id = module.postgresql_server.id subresource_names = var.subresource_names request_message = var.request_message tags = local.private_endpoint_tags From 56be0a85aebf22486bf140abff4d240ca40b8c03 Mon Sep 17 00:00:00 2001 From: payasam-raghuramakrishna-nttd <340229@nttdata.com> Date: Mon, 18 Aug 2025 19:51:50 +0530 Subject: [PATCH 25/27] Update locals.tf Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com> --- locals.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locals.tf b/locals.tf index c2d2106..d04fecf 100644 --- a/locals.tf +++ b/locals.tf @@ -16,7 +16,9 @@ locals { resource_group_name = module.resource_names["resource_group"].standard endpoint_name = "hygtmp-sandbox-004-neu-postgresql-001" private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) - private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" + endpoint_name = var.endpoint_name + private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) + private_service_connection_name = "${local.endpoint_name}-psc" default_tags = { "provisioner" = "terraform" } From fc820f6723cf2ecd4ee01dd81d447479baecb1ac Mon Sep 17 00:00:00 2001 From: payasam-raghuramakrishna-nttd <340229@nttdata.com> Date: Mon, 18 Aug 2025 19:52:02 +0530 Subject: [PATCH 26/27] Update locals.tf Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com> --- locals.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locals.tf b/locals.tf index d04fecf..a435bc4 100644 --- a/locals.tf +++ b/locals.tf @@ -21,7 +21,11 @@ locals { private_service_connection_name = "${local.endpoint_name}-psc" default_tags = { "provisioner" = "terraform" + default_tags = { + "provisioner" = "terraform" } + private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) + private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" } \ No newline at end of file From 45134aea1462b5b313188c1cb8ed579080e6f394 Mon Sep 17 00:00:00 2001 From: payasam-raghuramakrishna-nttd <340229@nttdata.com> Date: Mon, 18 Aug 2025 19:52:13 +0530 Subject: [PATCH 27/27] Update main.tf Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com> --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index ae2cd96..dc0e5a3 100644 --- a/main.tf +++ b/main.tf @@ -122,5 +122,5 @@ module "private_endpoint" { tags = local.private_endpoint_tags private_service_connection_name = local.private_service_connection_name - # depends_on = [module.postgresql_server] + depends_on = [module.postgresql_server] } \ No newline at end of file