Skip to content

Commit e490ebe

Browse files
committed
review: added feature to the autogen directory
1 parent d626c69 commit e490ebe

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

autogen/cluster_regional.tf

+10-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
// This file was automatically generated from a template in ./autogen
17+
{{ autogeneration_note }}
1818

1919
/******************************************
2020
Create regional cluster
2121
*****************************************/
2222
resource "google_container_cluster" "primary" {
23-
provider = "google"
23+
provider = "{% if private_cluster %}google-beta{%else %}google{% endif %}"
2424
count = "${var.regional ? 1 : 0}"
2525
name = "${var.name}"
2626
description = "${var.description}"
@@ -93,6 +93,14 @@ resource "google_container_cluster" "primary" {
9393
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
9494
}
9595
}
96+
{% if private_cluster %}
97+
98+
private_cluster_config {
99+
enable_private_endpoint = "${var.enable_private_endpoint}"
100+
enable_private_nodes = "${var.enable_private_nodes}"
101+
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
102+
}
103+
{% endif %}
96104

97105
remove_default_node_pool = "${var.remove_default_node_pool}"
98106
}

autogen/cluster_zonal.tf

+10-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
// This file was automatically generated from a template in ./autogen
17+
{{ autogeneration_note }}
1818

1919
/******************************************
2020
Create zonal cluster
2121
*****************************************/
2222
resource "google_container_cluster" "zonal_primary" {
23-
provider = "google"
23+
provider = "{% if private_cluster %}google-beta{%else %}google{% endif %}"
2424
count = "${var.regional ? 0 : 1}"
2525
name = "${var.name}"
2626
description = "${var.description}"
@@ -93,6 +93,14 @@ resource "google_container_cluster" "zonal_primary" {
9393
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
9494
}
9595
}
96+
{% if private_cluster %}
97+
98+
private_cluster_config {
99+
enable_private_endpoint = "${var.enable_private_endpoint}"
100+
enable_private_nodes = "${var.enable_private_nodes}"
101+
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
102+
}
103+
{% endif %}
96104

97105
remove_default_node_pool = "${var.remove_default_node_pool}"
98106
}

modules/private-cluster/cluster_regional.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Create regional cluster
2121
*****************************************/
2222
resource "google_container_cluster" "primary" {
23-
provider = "google"
23+
provider = "google-beta"
2424
count = "${var.regional ? 1 : 0}"
2525
name = "${var.name}"
2626
description = "${var.description}"
@@ -94,6 +94,12 @@ resource "google_container_cluster" "primary" {
9494
}
9595
}
9696

97+
private_cluster_config {
98+
enable_private_endpoint = "${var.enable_private_endpoint}"
99+
enable_private_nodes = "${var.enable_private_nodes}"
100+
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
101+
}
102+
97103
remove_default_node_pool = "${var.remove_default_node_pool}"
98104
}
99105

modules/private-cluster/cluster_zonal.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Create zonal cluster
2121
*****************************************/
2222
resource "google_container_cluster" "zonal_primary" {
23-
provider = "google"
23+
provider = "google-beta"
2424
count = "${var.regional ? 0 : 1}"
2525
name = "${var.name}"
2626
description = "${var.description}"
@@ -94,6 +94,12 @@ resource "google_container_cluster" "zonal_primary" {
9494
}
9595
}
9696

97+
private_cluster_config {
98+
enable_private_endpoint = "${var.enable_private_endpoint}"
99+
enable_private_nodes = "${var.enable_private_nodes}"
100+
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
101+
}
102+
97103
remove_default_node_pool = "${var.remove_default_node_pool}"
98104
}
99105

0 commit comments

Comments
 (0)