diff --git a/modules/terraform-cdp-azure-pre-reqs/README.md b/modules/terraform-cdp-azure-pre-reqs/README.md index 3e7f2d4..8421ee5 100644 --- a/modules/terraform-cdp-azure-pre-reqs/README.md +++ b/modules/terraform-cdp-azure-pre-reqs/README.md @@ -85,6 +85,7 @@ In each directory an example `terraform.tfvars.sample` values file is included t | [cdp\_resourcegroup\_name](#input\_cdp\_resourcegroup\_name) | Pre-existing Resource Group for CDP environment. Required if create\_vnet is false. | `string` | `null` | no | | [cdp\_subnet\_names](#input\_cdp\_subnet\_names) | List of subnet names for CDP Resources. Required if create\_vnet is false. | `list(any)` | `null` | no | | [cdp\_subnet\_range](#input\_cdp\_subnet\_range) | Size of each (internal) cluster subnet. Required if create\_vpc is true. | `number` | `19` | no | +| [cdp\_subnets\_private\_endpoint\_network\_policies\_enabled](#input\_cdp\_subnets\_private\_endpoint\_network\_policies\_enabled) | Enable or Disable network policies for the private endpoint on the CDP subnets | `bool` | `true` | no | | [cdp\_vnet\_name](#input\_cdp\_vnet\_name) | Pre-existing VNet Name for CDP environment. Required if create\_vnet is false. | `string` | `null` | no | | [create\_azure\_cml\_nfs](#input\_create\_azure\_cml\_nfs) | Whether to create NFS for CML | `bool` | `false` | no | | [create\_vm\_mounting\_nfs](#input\_create\_vm\_mounting\_nfs) | Whether to create a VM which mounts this NFS | `bool` | `true` | no | @@ -97,6 +98,7 @@ In each directory an example `terraform.tfvars.sample` values file is included t | [enable\_raz](#input\_enable\_raz) | Flag to enable Ranger Authorization Service (RAZ) | `bool` | `true` | no | | [env\_tags](#input\_env\_tags) | Tags applied to provisioned resources | `map(any)` | `null` | no | | [gateway\_subnet\_range](#input\_gateway\_subnet\_range) | Size of each gateway subnet. Required if create\_vpc is true. | `number` | `24` | no | +| [gateway\_subnets\_private\_endpoint\_network\_policies\_enabled](#input\_gateway\_subnets\_private\_endpoint\_network\_policies\_enabled) | Enable or Disable network policies for the private endpoint on the Gateway subnets | `bool` | `true` | no | | [idbroker\_managed\_identity\_name](#input\_idbroker\_managed\_identity\_name) | IDBroker Managed Identity name | `string` | `null` | no | | [idbroker\_role\_assignments](#input\_idbroker\_role\_assignments) | List of Role Assignments for the IDBroker Managed Identity |
list(object({
role = string
description = string
})
)
|
[
{
"description": "Assign VM Contributor Role to IDBroker Identity at Subscription Level",
"role": "Virtual Machine Contributor"
},
{
"description": "Assign Managed Identity Operator Role to IDBroker Identity at Subscription Level",
"role": "Managed Identity Operator"
}
]
| no | | [ingress\_extra\_cidrs\_and\_ports](#input\_ingress\_extra\_cidrs\_and\_ports) | List of extra CIDR blocks and ports to include in Security Group Ingress rules |
object({
cidrs = list(string)
ports = list(number)
})
|
{
"cidrs": [],
"ports": []
}
| no | diff --git a/modules/terraform-cdp-azure-pre-reqs/main.tf b/modules/terraform-cdp-azure-pre-reqs/main.tf index 4a013a1..b1ca22c 100644 --- a/modules/terraform-cdp-azure-pre-reqs/main.tf +++ b/modules/terraform-cdp-azure-pre-reqs/main.tf @@ -43,6 +43,8 @@ module "azure_cdp_vnet" { cdp_subnet_range = var.cdp_subnet_range gateway_subnet_range = var.gateway_subnet_range + cdp_subnets_private_endpoint_network_policies_enabled = var.cdp_subnets_private_endpoint_network_policies_enabled + gateway_subnets_private_endpoint_network_policies_enabled = var.gateway_subnets_private_endpoint_network_policies_enabled } diff --git a/modules/terraform-cdp-azure-pre-reqs/modules/vnet/main.tf b/modules/terraform-cdp-azure-pre-reqs/modules/vnet/main.tf index 0c345f5..bd45b5c 100644 --- a/modules/terraform-cdp-azure-pre-reqs/modules/vnet/main.tf +++ b/modules/terraform-cdp-azure-pre-reqs/modules/vnet/main.tf @@ -36,7 +36,7 @@ resource "azurerm_subnet" "cdp_subnets" { address_prefixes = [each.value.cidr] service_endpoints = ["Microsoft.Sql", "Microsoft.Storage"] - private_endpoint_network_policies_enabled = true + private_endpoint_network_policies_enabled = var.cdp_subnets_private_endpoint_network_policies_enabled } @@ -50,6 +50,6 @@ resource "azurerm_subnet" "gateway_subnets" { address_prefixes = [each.value.cidr] service_endpoints = ["Microsoft.Sql", "Microsoft.Storage"] - private_endpoint_network_policies_enabled = true + private_endpoint_network_policies_enabled = var.gateway_subnets_private_endpoint_network_policies_enabled } diff --git a/modules/terraform-cdp-azure-pre-reqs/modules/vnet/variables.tf b/modules/terraform-cdp-azure-pre-reqs/modules/vnet/variables.tf index 1ea538d..c7aa0f5 100644 --- a/modules/terraform-cdp-azure-pre-reqs/modules/vnet/variables.tf +++ b/modules/terraform-cdp-azure-pre-reqs/modules/vnet/variables.tf @@ -74,3 +74,15 @@ variable "env_prefix" { type = string description = "Shorthand name for the environment. Used in resource descriptions" } + +variable "cdp_subnets_private_endpoint_network_policies_enabled" { + type = bool + + description = "Enable or Disable network policies for the private endpoint on the CDP subnets" +} + +variable "gateway_subnets_private_endpoint_network_policies_enabled" { + type = bool + + description = "Enable or Disable network policies for the private endpoint on the Gateway subnets" +} \ No newline at end of file diff --git a/modules/terraform-cdp-azure-pre-reqs/variables.tf b/modules/terraform-cdp-azure-pre-reqs/variables.tf index 9e3e267..3ea02b8 100644 --- a/modules/terraform-cdp-azure-pre-reqs/variables.tf +++ b/modules/terraform-cdp-azure-pre-reqs/variables.tf @@ -167,6 +167,22 @@ variable "ingress_extra_cidrs_and_ports" { } } +variable "cdp_subnets_private_endpoint_network_policies_enabled" { + type = bool + description = "Enable or Disable network policies for the private endpoint on the CDP subnets" + + default = true + +} + +variable "gateway_subnets_private_endpoint_network_policies_enabled" { + type = bool + + description = "Enable or Disable network policies for the private endpoint on the Gateway subnets" + + default = true +} + # ------- Storage Resources ------- variable "random_id_for_bucket" { type = bool