From 8571f61dcd35eb4bd06febea9d14b0ed409b2d0e Mon Sep 17 00:00:00 2001 From: Anshu Rao Date: Wed, 19 Feb 2020 08:24:09 -0600 Subject: [PATCH] Fix: Rolled back to basic path routing for networks (#434) * rolled back network data source * increase timeouts to 45m --- autogen/main/cluster.tf.tmpl | 16 ++++---- autogen/main/networks.tf.tmpl | 40 ------------------- cluster.tf | 16 ++++---- .../cluster.tf | 16 ++++---- .../networks.tf | 32 --------------- modules/beta-private-cluster/cluster.tf | 16 ++++---- modules/beta-private-cluster/networks.tf | 32 --------------- modules/beta-public-cluster/cluster.tf | 16 ++++---- modules/beta-public-cluster/networks.tf | 32 --------------- .../private-cluster-update-variant/cluster.tf | 16 ++++---- .../networks.tf | 32 --------------- modules/private-cluster/cluster.tf | 16 ++++---- modules/private-cluster/networks.tf | 32 --------------- 13 files changed, 56 insertions(+), 256 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 76eaf54f6..7e0dbfa01 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 @@ -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/autogen/main/networks.tf.tmpl b/autogen/main/networks.tf.tmpl deleted file mode 100644 index cff6762fa..000000000 --- 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 e65dcc682..4d484c7ba 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 @@ -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 ae28cc0a8..97fa514b6 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 @@ -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-update-variant/networks.tf b/modules/beta-private-cluster-update-variant/networks.tf deleted file mode 100644 index 668f101b0..000000000 --- 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 2cc0c2b85..f3db1661d 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 @@ -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-private-cluster/networks.tf b/modules/beta-private-cluster/networks.tf deleted file mode 100644 index 668f101b0..000000000 --- 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 92b515f96..d8b180c56 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 @@ -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/beta-public-cluster/networks.tf b/modules/beta-public-cluster/networks.tf deleted file mode 100644 index 668f101b0..000000000 --- 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 139e79ea7..955cd6389 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 @@ -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-update-variant/networks.tf b/modules/private-cluster-update-variant/networks.tf deleted file mode 100644 index 9281d0632..000000000 --- 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 877df33c4..9587f8bad 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 @@ -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" } } diff --git a/modules/private-cluster/networks.tf b/modules/private-cluster/networks.tf deleted file mode 100644 index 9281d0632..000000000 --- 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 -}