From d7a0f0dc6771889561a153f6cb3909ccef05d7ce Mon Sep 17 00:00:00 2001 From: Jim Enright Date: Thu, 7 Dec 2023 12:32:05 +0000 Subject: [PATCH] Add Azure create_private_endpoint param to cdp deploy module (#45) Signed-off-by: Jim Enright --- modules/terraform-cdp-deploy/README.md | 1 + modules/terraform-cdp-deploy/main.tf | 1 + modules/terraform-cdp-deploy/modules/azure/main.tf | 1 + modules/terraform-cdp-deploy/modules/azure/variables.tf | 6 ++++++ modules/terraform-cdp-deploy/variables.tf | 7 +++++++ 5 files changed, 16 insertions(+) diff --git a/modules/terraform-cdp-deploy/README.md b/modules/terraform-cdp-deploy/README.md index 6be8d26..ed7499e 100644 --- a/modules/terraform-cdp-deploy/README.md +++ b/modules/terraform-cdp-deploy/README.md @@ -59,6 +59,7 @@ No resources. | [azure\_aks\_private\_dns\_zone\_id](#input\_azure\_aks\_private\_dns\_zone\_id) | The ID of an existing private DNS zone used for the AKS. | `string` | `null` | no | | [azure\_cdp\_gateway\_subnet\_names](#input\_azure\_cdp\_gateway\_subnet\_names) | List of Azure Subnet Names CDP Endpoint Access Gateway. Required for CDP deployment on Azure. | `list(any)` | `null` | no | | [azure\_cdp\_subnet\_names](#input\_azure\_cdp\_subnet\_names) | List of Azure Subnet Names for CDP Resources. Required for CDP deployment on Azure. | `list(any)` | `null` | no | +| [azure\_create\_private\_endpoints](#input\_azure\_create\_private\_endpoints) | Flag to specify that Azure Postgres will be configured with Private Endpoint and a Private DNS Zone. | `bool` | `null` | no | | [azure\_database\_private\_dns\_zone\_id](#input\_azure\_database\_private\_dns\_zone\_id) | The ID of an existing private DNS zone used for the database. | `string` | `null` | no | | [azure\_datalakeadmin\_identity\_id](#input\_azure\_datalakeadmin\_identity\_id) | Datalake Admin Managed Identity ID. Required for CDP deployment on Azure. | `string` | `null` | no | | [azure\_idbroker\_identity\_id](#input\_azure\_idbroker\_identity\_id) | IDBroker Managed Identity ID. Required for CDP deployment on Azure. | `string` | `null` | no | diff --git a/modules/terraform-cdp-deploy/main.tf b/modules/terraform-cdp-deploy/main.tf index 9da8c27..ee83de8 100644 --- a/modules/terraform-cdp-deploy/main.tf +++ b/modules/terraform-cdp-deploy/main.tf @@ -152,6 +152,7 @@ module "cdp_on_azure" { azure_aks_private_dns_zone_id = var.azure_aks_private_dns_zone_id azure_database_private_dns_zone_id = var.azure_database_private_dns_zone_id + create_private_endpoints = var.azure_create_private_endpoints proxy_config_name = var.proxy_config_name diff --git a/modules/terraform-cdp-deploy/modules/azure/main.tf b/modules/terraform-cdp-deploy/modules/azure/main.tf index 8488523..eb7629a 100644 --- a/modules/terraform-cdp-deploy/modules/azure/main.tf +++ b/modules/terraform-cdp-deploy/modules/azure/main.tf @@ -51,6 +51,7 @@ resource "cdp_environments_azure_environment" "cdp_env" { aks_private_dns_zone_id = var.azure_aks_private_dns_zone_id database_private_dns_zone_id = var.azure_database_private_dns_zone_id } + create_private_endpoints = var.create_private_endpoints endpoint_access_gateway_scheme = var.endpoint_access_scheme endpoint_access_gateway_subnet_ids = (length(var.cdp_gateway_subnet_names) > 0) ? var.cdp_gateway_subnet_names : null diff --git a/modules/terraform-cdp-deploy/modules/azure/variables.tf b/modules/terraform-cdp-deploy/modules/azure/variables.tf index f987bfb..ba9804d 100644 --- a/modules/terraform-cdp-deploy/modules/azure/variables.tf +++ b/modules/terraform-cdp-deploy/modules/azure/variables.tf @@ -288,6 +288,12 @@ variable "azure_database_private_dns_zone_id" { } +variable "create_private_endpoints" { + type = bool + description = "Azure Postgres will be configured with Private Endpoint and a Private DNS Zone." + +} + variable "cdp_gateway_subnet_names" { type = list(any) description = "Azure Subnet Names for Endpoint Access Gateway." diff --git a/modules/terraform-cdp-deploy/variables.tf b/modules/terraform-cdp-deploy/variables.tf index ebc0789..91fe8f9 100644 --- a/modules/terraform-cdp-deploy/variables.tf +++ b/modules/terraform-cdp-deploy/variables.tf @@ -503,6 +503,13 @@ variable "azure_database_private_dns_zone_id" { } +variable "azure_create_private_endpoints" { + type = bool + description = "Flag to specify that Azure Postgres will be configured with Private Endpoint and a Private DNS Zone." + + default = null +} + variable "azure_cdp_subnet_names" { type = list(any) description = "List of Azure Subnet Names for CDP Resources. Required for CDP deployment on Azure."