Skip to content

Commit

Permalink
review: added feature to the autogen directory
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkonkin committed Jun 3, 2019
1 parent deac2ee commit 6086f62
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
12 changes: 10 additions & 2 deletions autogen/cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

// This file was automatically generated from a template in ./autogen
{{ autogeneration_note }}

/******************************************
Create regional cluster
*****************************************/
resource "google_container_cluster" "primary" {
provider = "google"
provider = "{% if private_cluster %}google-beta{%else %}google{% endif %}"
count = "${var.regional ? 1 : 0}"
name = "${var.name}"
description = "${var.description}"
Expand Down Expand Up @@ -93,6 +93,14 @@ resource "google_container_cluster" "primary" {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
}
}
{% if private_cluster %}

private_cluster_config {
enable_private_endpoint = "${var.enable_private_endpoint}"
enable_private_nodes = "${var.enable_private_nodes}"
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
}
{% endif %}

remove_default_node_pool = "${var.remove_default_node_pool}"
}
Expand Down
12 changes: 10 additions & 2 deletions autogen/cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

// This file was automatically generated from a template in ./autogen
{{ autogeneration_note }}

/******************************************
Create zonal cluster
*****************************************/
resource "google_container_cluster" "zonal_primary" {
provider = "google"
provider = "{% if private_cluster %}google-beta{%else %}google{% endif %}"
count = "${var.regional ? 0 : 1}"
name = "${var.name}"
description = "${var.description}"
Expand Down Expand Up @@ -93,6 +93,14 @@ resource "google_container_cluster" "zonal_primary" {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
}
}
{% if private_cluster %}

private_cluster_config {
enable_private_endpoint = "${var.enable_private_endpoint}"
enable_private_nodes = "${var.enable_private_nodes}"
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
}
{% endif %}

remove_default_node_pool = "${var.remove_default_node_pool}"
}
Expand Down
8 changes: 7 additions & 1 deletion modules/private-cluster/cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Create regional cluster
*****************************************/
resource "google_container_cluster" "primary" {
provider = "google"
provider = "google-beta"
count = "${var.regional ? 1 : 0}"
name = "${var.name}"
description = "${var.description}"
Expand Down Expand Up @@ -94,6 +94,12 @@ resource "google_container_cluster" "primary" {
}
}

private_cluster_config {
enable_private_endpoint = "${var.enable_private_endpoint}"
enable_private_nodes = "${var.enable_private_nodes}"
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
}

remove_default_node_pool = "${var.remove_default_node_pool}"
}

Expand Down
8 changes: 7 additions & 1 deletion modules/private-cluster/cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Create zonal cluster
*****************************************/
resource "google_container_cluster" "zonal_primary" {
provider = "google"
provider = "google-beta"
count = "${var.regional ? 0 : 1}"
name = "${var.name}"
description = "${var.description}"
Expand Down Expand Up @@ -94,6 +94,12 @@ resource "google_container_cluster" "zonal_primary" {
}
}

private_cluster_config {
enable_private_endpoint = "${var.enable_private_endpoint}"
enable_private_nodes = "${var.enable_private_nodes}"
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
}

remove_default_node_pool = "${var.remove_default_node_pool}"
}

Expand Down

0 comments on commit 6086f62

Please sign in to comment.