diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index c62a16365f..0d2a75192d 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -569,15 +569,17 @@ resource "google_container_cluster" "primary" { {% if private_cluster %} dynamic "private_cluster_config" { for_each = var.enable_private_nodes ? [{ - enable_private_nodes = var.enable_private_nodes, - enable_private_endpoint = var.enable_private_endpoint - master_ipv4_cidr_block = var.master_ipv4_cidr_block + enable_private_nodes = var.enable_private_nodes, + enable_private_endpoint = var.enable_private_endpoint + master_ipv4_cidr_block = var.master_ipv4_cidr_block + private_endpoint_subnetwork = var.private_endpoint_subnetwork }] : [] content { - enable_private_endpoint = private_cluster_config.value.enable_private_endpoint - enable_private_nodes = private_cluster_config.value.enable_private_nodes - master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + enable_private_endpoint = private_cluster_config.value.enable_private_endpoint + enable_private_nodes = private_cluster_config.value.enable_private_nodes + master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + private_endpoint_subnetwork = private_cluster_config.value.private_endpoint_subnetwork dynamic "master_global_access_config" { for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : [] content { diff --git a/autogen/main/variables.tf.tmpl b/autogen/main/variables.tf.tmpl index 79f0381a7b..196d4065f5 100644 --- a/autogen/main/variables.tf.tmpl +++ b/autogen/main/variables.tf.tmpl @@ -469,6 +469,12 @@ variable "master_ipv4_cidr_block" { {% endif %} } +variable "private_endpoint_subnetwork" { + type = string + description = "The subnetwork to use for the hosted master network." + default = null +} + variable "master_global_access_enabled" { type = bool description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint." diff --git a/modules/beta-autopilot-private-cluster/README.md b/modules/beta-autopilot-private-cluster/README.md index cf9f3b1eff..2f6b48b146 100644 --- a/modules/beta-autopilot-private-cluster/README.md +++ b/modules/beta-autopilot-private-cluster/README.md @@ -132,6 +132,7 @@ Then perform the following commands on the root folder: | non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | `list(string)` |
[| no | | notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no | | notification\_filter\_event\_type | Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Can be used to filter what notifications are sent. Accepted values are UPGRADE\_AVAILABLE\_EVENT, UPGRADE\_EVENT, and SECURITY\_BULLETIN\_EVENT. | `list(string)` | `[]` | no | +| private\_endpoint\_subnetwork | The subnetwork to use for the hosted master network. | `string` | `null` | no | | project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes | | region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no | | regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no | diff --git a/modules/beta-autopilot-private-cluster/cluster.tf b/modules/beta-autopilot-private-cluster/cluster.tf index e31caa28ff..0a8fd598b6 100644 --- a/modules/beta-autopilot-private-cluster/cluster.tf +++ b/modules/beta-autopilot-private-cluster/cluster.tf @@ -262,15 +262,17 @@ resource "google_container_cluster" "primary" { dynamic "private_cluster_config" { for_each = var.enable_private_nodes ? [{ - enable_private_nodes = var.enable_private_nodes, - enable_private_endpoint = var.enable_private_endpoint - master_ipv4_cidr_block = var.master_ipv4_cidr_block + enable_private_nodes = var.enable_private_nodes, + enable_private_endpoint = var.enable_private_endpoint + master_ipv4_cidr_block = var.master_ipv4_cidr_block + private_endpoint_subnetwork = var.private_endpoint_subnetwork }] : [] content { - enable_private_endpoint = private_cluster_config.value.enable_private_endpoint - enable_private_nodes = private_cluster_config.value.enable_private_nodes - master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + enable_private_endpoint = private_cluster_config.value.enable_private_endpoint + enable_private_nodes = private_cluster_config.value.enable_private_nodes + master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + private_endpoint_subnetwork = private_cluster_config.value.private_endpoint_subnetwork dynamic "master_global_access_config" { for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : [] content { diff --git a/modules/beta-autopilot-private-cluster/variables.tf b/modules/beta-autopilot-private-cluster/variables.tf index 3b2be13fc7..c39bf7b18a 100644 --- a/modules/beta-autopilot-private-cluster/variables.tf +++ b/modules/beta-autopilot-private-cluster/variables.tf @@ -288,6 +288,12 @@ variable "master_ipv4_cidr_block" { default = null } +variable "private_endpoint_subnetwork" { + type = string + description = "The subnetwork to use for the hosted master network." + default = null +} + variable "master_global_access_enabled" { type = bool description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint." diff --git a/modules/beta-private-cluster-update-variant/README.md b/modules/beta-private-cluster-update-variant/README.md index 67f67570fb..9cb57ee6dc 100644 --- a/modules/beta-private-cluster-update-variant/README.md +++ b/modules/beta-private-cluster-update-variant/README.md @@ -273,6 +273,7 @@ Then perform the following commands on the root folder: | non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | `list(string)` |
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
]
[| no | | notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no | | notification\_filter\_event\_type | Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Can be used to filter what notifications are sent. Accepted values are UPGRADE\_AVAILABLE\_EVENT, UPGRADE\_EVENT, and SECURITY\_BULLETIN\_EVENT. | `list(string)` | `[]` | no | +| private\_endpoint\_subnetwork | The subnetwork to use for the hosted master network. | `string` | `null` | no | | project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes | | region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no | | regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no | diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index 05d10baefa..08f0929170 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -490,15 +490,17 @@ resource "google_container_cluster" "primary" { dynamic "private_cluster_config" { for_each = var.enable_private_nodes ? [{ - enable_private_nodes = var.enable_private_nodes, - enable_private_endpoint = var.enable_private_endpoint - master_ipv4_cidr_block = var.master_ipv4_cidr_block + enable_private_nodes = var.enable_private_nodes, + enable_private_endpoint = var.enable_private_endpoint + master_ipv4_cidr_block = var.master_ipv4_cidr_block + private_endpoint_subnetwork = var.private_endpoint_subnetwork }] : [] content { - enable_private_endpoint = private_cluster_config.value.enable_private_endpoint - enable_private_nodes = private_cluster_config.value.enable_private_nodes - master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + enable_private_endpoint = private_cluster_config.value.enable_private_endpoint + enable_private_nodes = private_cluster_config.value.enable_private_nodes + master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + private_endpoint_subnetwork = private_cluster_config.value.private_endpoint_subnetwork dynamic "master_global_access_config" { for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : [] content { diff --git a/modules/beta-private-cluster-update-variant/variables.tf b/modules/beta-private-cluster-update-variant/variables.tf index 89cc5ec60b..6f7addac77 100644 --- a/modules/beta-private-cluster-update-variant/variables.tf +++ b/modules/beta-private-cluster-update-variant/variables.tf @@ -452,6 +452,12 @@ variable "master_ipv4_cidr_block" { default = "10.0.0.0/28" } +variable "private_endpoint_subnetwork" { + type = string + description = "The subnetwork to use for the hosted master network." + default = null +} + variable "master_global_access_enabled" { type = bool description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint." diff --git a/modules/beta-private-cluster/README.md b/modules/beta-private-cluster/README.md index 657aeeab2b..ce5f9edebb 100644 --- a/modules/beta-private-cluster/README.md +++ b/modules/beta-private-cluster/README.md @@ -251,6 +251,7 @@ Then perform the following commands on the root folder: | non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | `list(string)` |
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
]
[| no | | notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no | | notification\_filter\_event\_type | Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Can be used to filter what notifications are sent. Accepted values are UPGRADE\_AVAILABLE\_EVENT, UPGRADE\_EVENT, and SECURITY\_BULLETIN\_EVENT. | `list(string)` | `[]` | no | +| private\_endpoint\_subnetwork | The subnetwork to use for the hosted master network. | `string` | `null` | no | | project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes | | region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no | | regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no | diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 0dcb07caf4..4293081a77 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -490,15 +490,17 @@ resource "google_container_cluster" "primary" { dynamic "private_cluster_config" { for_each = var.enable_private_nodes ? [{ - enable_private_nodes = var.enable_private_nodes, - enable_private_endpoint = var.enable_private_endpoint - master_ipv4_cidr_block = var.master_ipv4_cidr_block + enable_private_nodes = var.enable_private_nodes, + enable_private_endpoint = var.enable_private_endpoint + master_ipv4_cidr_block = var.master_ipv4_cidr_block + private_endpoint_subnetwork = var.private_endpoint_subnetwork }] : [] content { - enable_private_endpoint = private_cluster_config.value.enable_private_endpoint - enable_private_nodes = private_cluster_config.value.enable_private_nodes - master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + enable_private_endpoint = private_cluster_config.value.enable_private_endpoint + enable_private_nodes = private_cluster_config.value.enable_private_nodes + master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + private_endpoint_subnetwork = private_cluster_config.value.private_endpoint_subnetwork dynamic "master_global_access_config" { for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : [] content { diff --git a/modules/beta-private-cluster/variables.tf b/modules/beta-private-cluster/variables.tf index 89cc5ec60b..6f7addac77 100644 --- a/modules/beta-private-cluster/variables.tf +++ b/modules/beta-private-cluster/variables.tf @@ -452,6 +452,12 @@ variable "master_ipv4_cidr_block" { default = "10.0.0.0/28" } +variable "private_endpoint_subnetwork" { + type = string + description = "The subnetwork to use for the hosted master network." + default = null +} + variable "master_global_access_enabled" { type = bool description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint." diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index f4cce9271f..d081dc81b1 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -258,6 +258,7 @@ Then perform the following commands on the root folder: | non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | `list(string)` |
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
]
[| no | | notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no | | notification\_filter\_event\_type | Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Can be used to filter what notifications are sent. Accepted values are UPGRADE\_AVAILABLE\_EVENT, UPGRADE\_EVENT, and SECURITY\_BULLETIN\_EVENT. | `list(string)` | `[]` | no | +| private\_endpoint\_subnetwork | The subnetwork to use for the hosted master network. | `string` | `null` | no | | project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes | | region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no | | regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no | diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 7a6a74556f..12705fc437 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -436,15 +436,17 @@ resource "google_container_cluster" "primary" { dynamic "private_cluster_config" { for_each = var.enable_private_nodes ? [{ - enable_private_nodes = var.enable_private_nodes, - enable_private_endpoint = var.enable_private_endpoint - master_ipv4_cidr_block = var.master_ipv4_cidr_block + enable_private_nodes = var.enable_private_nodes, + enable_private_endpoint = var.enable_private_endpoint + master_ipv4_cidr_block = var.master_ipv4_cidr_block + private_endpoint_subnetwork = var.private_endpoint_subnetwork }] : [] content { - enable_private_endpoint = private_cluster_config.value.enable_private_endpoint - enable_private_nodes = private_cluster_config.value.enable_private_nodes - master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + enable_private_endpoint = private_cluster_config.value.enable_private_endpoint + enable_private_nodes = private_cluster_config.value.enable_private_nodes + master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + private_endpoint_subnetwork = private_cluster_config.value.private_endpoint_subnetwork dynamic "master_global_access_config" { for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : [] content { diff --git a/modules/private-cluster-update-variant/variables.tf b/modules/private-cluster-update-variant/variables.tf index f1cff54bdd..9620249913 100644 --- a/modules/private-cluster-update-variant/variables.tf +++ b/modules/private-cluster-update-variant/variables.tf @@ -446,6 +446,12 @@ variable "master_ipv4_cidr_block" { default = "10.0.0.0/28" } +variable "private_endpoint_subnetwork" { + type = string + description = "The subnetwork to use for the hosted master network." + default = null +} + variable "master_global_access_enabled" { type = bool description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint." diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index 3e4b65d152..9aee5725fa 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -236,6 +236,7 @@ Then perform the following commands on the root folder: | non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | `list(string)` |
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
]
[| no | | notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no | | notification\_filter\_event\_type | Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Can be used to filter what notifications are sent. Accepted values are UPGRADE\_AVAILABLE\_EVENT, UPGRADE\_EVENT, and SECURITY\_BULLETIN\_EVENT. | `list(string)` | `[]` | no | +| private\_endpoint\_subnetwork | The subnetwork to use for the hosted master network. | `string` | `null` | no | | project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes | | region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no | | regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no | diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 334bcc2e8d..907ac71839 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -436,15 +436,17 @@ resource "google_container_cluster" "primary" { dynamic "private_cluster_config" { for_each = var.enable_private_nodes ? [{ - enable_private_nodes = var.enable_private_nodes, - enable_private_endpoint = var.enable_private_endpoint - master_ipv4_cidr_block = var.master_ipv4_cidr_block + enable_private_nodes = var.enable_private_nodes, + enable_private_endpoint = var.enable_private_endpoint + master_ipv4_cidr_block = var.master_ipv4_cidr_block + private_endpoint_subnetwork = var.private_endpoint_subnetwork }] : [] content { - enable_private_endpoint = private_cluster_config.value.enable_private_endpoint - enable_private_nodes = private_cluster_config.value.enable_private_nodes - master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + enable_private_endpoint = private_cluster_config.value.enable_private_endpoint + enable_private_nodes = private_cluster_config.value.enable_private_nodes + master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block + private_endpoint_subnetwork = private_cluster_config.value.private_endpoint_subnetwork dynamic "master_global_access_config" { for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : [] content { diff --git a/modules/private-cluster/variables.tf b/modules/private-cluster/variables.tf index f1cff54bdd..9620249913 100644 --- a/modules/private-cluster/variables.tf +++ b/modules/private-cluster/variables.tf @@ -446,6 +446,12 @@ variable "master_ipv4_cidr_block" { default = "10.0.0.0/28" } +variable "private_endpoint_subnetwork" { + type = string + description = "The subnetwork to use for the hosted master network." + default = null +} + variable "master_global_access_enabled" { type = bool description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
]