From 40e78b514f455d8d1f45dc4afea2987e7c01da4b Mon Sep 17 00:00:00 2001 From: ChandranshuRao14 Date: Fri, 14 Feb 2020 13:22:24 -0600 Subject: [PATCH 1/2] rolled back network data source --- autogen/main/cluster.tf.tmpl | 4 +- autogen/main/networks.tf.tmpl | 40 ------------------- cluster.tf | 4 +- .../cluster.tf | 4 +- .../networks.tf | 32 --------------- modules/beta-private-cluster/cluster.tf | 4 +- modules/beta-private-cluster/networks.tf | 32 --------------- modules/beta-public-cluster/cluster.tf | 4 +- modules/beta-public-cluster/networks.tf | 32 --------------- .../private-cluster-update-variant/cluster.tf | 4 +- .../networks.tf | 32 --------------- modules/private-cluster/cluster.tf | 4 +- modules/private-cluster/networks.tf | 32 --------------- 13 files changed, 14 insertions(+), 214 deletions(-) delete mode 100644 autogen/main/networks.tf.tmpl delete mode 100644 modules/beta-private-cluster-update-variant/networks.tf delete mode 100644 modules/beta-private-cluster/networks.tf delete mode 100644 modules/beta-public-cluster/networks.tf delete mode 100644 modules/private-cluster-update-variant/networks.tf delete mode 100644 modules/private-cluster/networks.tf diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 76eaf54f67..7f1621cac6 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -34,7 +34,7 @@ resource "google_container_cluster" "primary" { location = local.location node_locations = local.node_locations cluster_ipv4_cidr = var.cluster_ipv4_cidr - network = data.google_compute_network.gke_network.self_link + network = "projects/${local.network_project_id}/global/networks/${var.network}" dynamic "network_policy" { for_each = local.cluster_network_policy @@ -55,7 +55,7 @@ resource "google_container_cluster" "primary" { } {% endif %} - subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link + subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}" {% if beta_cluster %} min_master_version = var.release_channel != null ? null : local.master_version diff --git a/autogen/main/networks.tf.tmpl b/autogen/main/networks.tf.tmpl deleted file mode 100644 index cff6762fa3..0000000000 --- a/autogen/main/networks.tf.tmpl +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{{ autogeneration_note }} - -data "google_compute_network" "gke_network" { - {% if beta_cluster %} - provider = google-beta - {% else %} - provider = google - {% endif %} - - name = var.network - project = local.network_project_id -} - -data "google_compute_subnetwork" "gke_subnetwork" { - {% if beta_cluster %} - provider = google-beta - {% else %} - provider = google - {% endif %} - - name = var.subnetwork - region = local.region - project = local.network_project_id -} diff --git a/cluster.tf b/cluster.tf index e65dcc6829..e8918ce646 100644 --- a/cluster.tf +++ b/cluster.tf @@ -30,7 +30,7 @@ resource "google_container_cluster" "primary" { location = local.location node_locations = local.node_locations cluster_ipv4_cidr = var.cluster_ipv4_cidr - network = data.google_compute_network.gke_network.self_link + network = "projects/${local.network_project_id}/global/networks/${var.network}" dynamic "network_policy" { for_each = local.cluster_network_policy @@ -42,7 +42,7 @@ resource "google_container_cluster" "primary" { } - subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link + subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}" min_master_version = local.master_version diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index ae28cc0a8d..6a3df5c37b 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -30,7 +30,7 @@ resource "google_container_cluster" "primary" { location = local.location node_locations = local.node_locations cluster_ipv4_cidr = var.cluster_ipv4_cidr - network = data.google_compute_network.gke_network.self_link + network = "projects/${local.network_project_id}/global/networks/${var.network}" dynamic "network_policy" { for_each = local.cluster_network_policy @@ -49,7 +49,7 @@ resource "google_container_cluster" "primary" { } } - subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link + subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}" min_master_version = var.release_channel != null ? null : local.master_version diff --git a/modules/beta-private-cluster-update-variant/networks.tf b/modules/beta-private-cluster-update-variant/networks.tf deleted file mode 100644 index 668f101b04..0000000000 --- a/modules/beta-private-cluster-update-variant/networks.tf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// This file was automatically generated from a template in ./autogen/main - -data "google_compute_network" "gke_network" { - provider = google-beta - - name = var.network - project = local.network_project_id -} - -data "google_compute_subnetwork" "gke_subnetwork" { - provider = google-beta - - name = var.subnetwork - region = local.region - project = local.network_project_id -} diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 2cc0c2b857..edb6ba9060 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -30,7 +30,7 @@ resource "google_container_cluster" "primary" { location = local.location node_locations = local.node_locations cluster_ipv4_cidr = var.cluster_ipv4_cidr - network = data.google_compute_network.gke_network.self_link + network = "projects/${local.network_project_id}/global/networks/${var.network}" dynamic "network_policy" { for_each = local.cluster_network_policy @@ -49,7 +49,7 @@ resource "google_container_cluster" "primary" { } } - subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link + subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}" min_master_version = var.release_channel != null ? null : local.master_version diff --git a/modules/beta-private-cluster/networks.tf b/modules/beta-private-cluster/networks.tf deleted file mode 100644 index 668f101b04..0000000000 --- a/modules/beta-private-cluster/networks.tf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// This file was automatically generated from a template in ./autogen/main - -data "google_compute_network" "gke_network" { - provider = google-beta - - name = var.network - project = local.network_project_id -} - -data "google_compute_subnetwork" "gke_subnetwork" { - provider = google-beta - - name = var.subnetwork - region = local.region - project = local.network_project_id -} diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index 92b515f964..e78a6a8739 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -30,7 +30,7 @@ resource "google_container_cluster" "primary" { location = local.location node_locations = local.node_locations cluster_ipv4_cidr = var.cluster_ipv4_cidr - network = data.google_compute_network.gke_network.self_link + network = "projects/${local.network_project_id}/global/networks/${var.network}" dynamic "network_policy" { for_each = local.cluster_network_policy @@ -49,7 +49,7 @@ resource "google_container_cluster" "primary" { } } - subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link + subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}" min_master_version = var.release_channel != null ? null : local.master_version diff --git a/modules/beta-public-cluster/networks.tf b/modules/beta-public-cluster/networks.tf deleted file mode 100644 index 668f101b04..0000000000 --- a/modules/beta-public-cluster/networks.tf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// This file was automatically generated from a template in ./autogen/main - -data "google_compute_network" "gke_network" { - provider = google-beta - - name = var.network - project = local.network_project_id -} - -data "google_compute_subnetwork" "gke_subnetwork" { - provider = google-beta - - name = var.subnetwork - region = local.region - project = local.network_project_id -} diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 139e79ea7c..950ea8166b 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -30,7 +30,7 @@ resource "google_container_cluster" "primary" { location = local.location node_locations = local.node_locations cluster_ipv4_cidr = var.cluster_ipv4_cidr - network = data.google_compute_network.gke_network.self_link + network = "projects/${local.network_project_id}/global/networks/${var.network}" dynamic "network_policy" { for_each = local.cluster_network_policy @@ -42,7 +42,7 @@ resource "google_container_cluster" "primary" { } - subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link + subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}" min_master_version = local.master_version diff --git a/modules/private-cluster-update-variant/networks.tf b/modules/private-cluster-update-variant/networks.tf deleted file mode 100644 index 9281d06326..0000000000 --- a/modules/private-cluster-update-variant/networks.tf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// This file was automatically generated from a template in ./autogen/main - -data "google_compute_network" "gke_network" { - provider = google - - name = var.network - project = local.network_project_id -} - -data "google_compute_subnetwork" "gke_subnetwork" { - provider = google - - name = var.subnetwork - region = local.region - project = local.network_project_id -} diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 877df33c49..4a636a96d3 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -30,7 +30,7 @@ resource "google_container_cluster" "primary" { location = local.location node_locations = local.node_locations cluster_ipv4_cidr = var.cluster_ipv4_cidr - network = data.google_compute_network.gke_network.self_link + network = "projects/${local.network_project_id}/global/networks/${var.network}" dynamic "network_policy" { for_each = local.cluster_network_policy @@ -42,7 +42,7 @@ resource "google_container_cluster" "primary" { } - subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link + subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}" min_master_version = local.master_version diff --git a/modules/private-cluster/networks.tf b/modules/private-cluster/networks.tf deleted file mode 100644 index 9281d06326..0000000000 --- a/modules/private-cluster/networks.tf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// This file was automatically generated from a template in ./autogen/main - -data "google_compute_network" "gke_network" { - provider = google - - name = var.network - project = local.network_project_id -} - -data "google_compute_subnetwork" "gke_subnetwork" { - provider = google - - name = var.subnetwork - region = local.region - project = local.network_project_id -} From 4669143c6cf650076e623442d5c894258a8c2ea7 Mon Sep 17 00:00:00 2001 From: ChandranshuRao14 Date: Tue, 18 Feb 2020 17:28:35 -0600 Subject: [PATCH 2/2] increase timeouts to 45m --- autogen/main/cluster.tf.tmpl | 12 ++++++------ cluster.tf | 12 ++++++------ .../beta-private-cluster-update-variant/cluster.tf | 12 ++++++------ modules/beta-private-cluster/cluster.tf | 12 ++++++------ modules/beta-public-cluster/cluster.tf | 12 ++++++------ modules/private-cluster-update-variant/cluster.tf | 12 ++++++------ modules/private-cluster/cluster.tf | 12 ++++++------ 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 7f1621cac6..7e0dbfa012 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -189,9 +189,9 @@ resource "google_container_cluster" "primary" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } node_pool { @@ -486,9 +486,9 @@ resource "google_container_node_pool" "pools" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } } diff --git a/cluster.tf b/cluster.tf index e8918ce646..4d484c7bab 100644 --- a/cluster.tf +++ b/cluster.tf @@ -101,9 +101,9 @@ resource "google_container_cluster" "primary" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } node_pool { @@ -218,9 +218,9 @@ resource "google_container_node_pool" "pools" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } } diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index 6a3df5c37b..97fa514b6f 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -169,9 +169,9 @@ resource "google_container_cluster" "primary" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } node_pool { @@ -438,9 +438,9 @@ resource "google_container_node_pool" "pools" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } } diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index edb6ba9060..f3db1661db 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -169,9 +169,9 @@ resource "google_container_cluster" "primary" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } node_pool { @@ -365,9 +365,9 @@ resource "google_container_node_pool" "pools" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } } diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index e78a6a8739..d8b180c569 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -169,9 +169,9 @@ resource "google_container_cluster" "primary" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } node_pool { @@ -352,9 +352,9 @@ resource "google_container_node_pool" "pools" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } } diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 950ea8166b..955cd63893 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -101,9 +101,9 @@ resource "google_container_cluster" "primary" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } node_pool { @@ -304,9 +304,9 @@ resource "google_container_node_pool" "pools" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } } diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 4a636a96d3..9587f8bad3 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -101,9 +101,9 @@ resource "google_container_cluster" "primary" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } node_pool { @@ -231,9 +231,9 @@ resource "google_container_node_pool" "pools" { } timeouts { - create = "30m" - update = "30m" - delete = "30m" + create = "45m" + update = "45m" + delete = "45m" } }