From 10a2f46245135edbd807cf9c9c76b9b5ea66cb03 Mon Sep 17 00:00:00 2001 From: cloud-foundation-bot <60107303+cloud-foundation-bot@users.noreply.github.com> Date: Wed, 22 Dec 2021 13:48:53 -0600 Subject: [PATCH] feat: update TPG version constraints to allow 4.0 (#33) * feat: update TPG version constraints to allow 4.0 * Delete make_source.sh Co-authored-by: Bharath KKB --- examples/forwarding-zone/versions.tf | 12 +++++++++- examples/peering-zone/versions.tf | 12 +++++++++- examples/private-zone/providers.tf | 23 ------------------ .../providers.tf => private-zone/versions.tf} | 20 ++++++++++------ examples/public-zone/providers.tf | 23 ------------------ .../providers.tf => public-zone/versions.tf} | 20 ++++++++++------ test/setup/make_source.sh | 24 ------------------- test/setup/versions.tf | 20 +++++++++------- versions.tf | 4 ++-- 9 files changed, 61 insertions(+), 97 deletions(-) delete mode 100644 examples/private-zone/providers.tf rename examples/{forwarding-zone/providers.tf => private-zone/versions.tf} (67%) delete mode 100644 examples/public-zone/providers.tf rename examples/{peering-zone/providers.tf => public-zone/versions.tf} (67%) delete mode 100755 test/setup/make_source.sh diff --git a/examples/forwarding-zone/versions.tf b/examples/forwarding-zone/versions.tf index 2970427..122b5a5 100644 --- a/examples/forwarding-zone/versions.tf +++ b/examples/forwarding-zone/versions.tf @@ -15,5 +15,15 @@ */ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + google-beta = { + source = "hashicorp/google-beta" + version = "~> 4.0" + } + } } diff --git a/examples/peering-zone/versions.tf b/examples/peering-zone/versions.tf index 832ec1d..396bd73 100644 --- a/examples/peering-zone/versions.tf +++ b/examples/peering-zone/versions.tf @@ -15,5 +15,15 @@ */ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + google-beta = { + source = "hashicorp/google-beta" + version = "~> 4.0" + } + } } diff --git a/examples/private-zone/providers.tf b/examples/private-zone/providers.tf deleted file mode 100644 index 01ad976..0000000 --- a/examples/private-zone/providers.tf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright 2019 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. - */ - -provider "google" { - version = ">= 3.63.0" -} - -provider "google-beta" { - version = ">= 3.63.0" -} diff --git a/examples/forwarding-zone/providers.tf b/examples/private-zone/versions.tf similarity index 67% rename from examples/forwarding-zone/providers.tf rename to examples/private-zone/versions.tf index 7b4094f..c7fc4a6 100644 --- a/examples/forwarding-zone/providers.tf +++ b/examples/private-zone/versions.tf @@ -1,5 +1,5 @@ /** - * Copyright 2019 Google LLC + * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,16 @@ * limitations under the License. */ -provider "google" { - version = ">= 2.14" -} - -provider "google-beta" { - version = ">= 2.14" +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + google-beta = { + source = "hashicorp/google-beta" + version = "~> 4.0" + } + } + required_version = ">= 0.13" } diff --git a/examples/public-zone/providers.tf b/examples/public-zone/providers.tf deleted file mode 100644 index 01ad976..0000000 --- a/examples/public-zone/providers.tf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright 2019 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. - */ - -provider "google" { - version = ">= 3.63.0" -} - -provider "google-beta" { - version = ">= 3.63.0" -} diff --git a/examples/peering-zone/providers.tf b/examples/public-zone/versions.tf similarity index 67% rename from examples/peering-zone/providers.tf rename to examples/public-zone/versions.tf index 7b4094f..c7fc4a6 100644 --- a/examples/peering-zone/providers.tf +++ b/examples/public-zone/versions.tf @@ -1,5 +1,5 @@ /** - * Copyright 2019 Google LLC + * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,16 @@ * limitations under the License. */ -provider "google" { - version = ">= 2.14" -} - -provider "google-beta" { - version = ">= 2.14" +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + google-beta = { + source = "hashicorp/google-beta" + version = "~> 4.0" + } + } + required_version = ">= 0.13" } diff --git a/test/setup/make_source.sh b/test/setup/make_source.sh deleted file mode 100755 index f2b63a6..0000000 --- a/test/setup/make_source.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2019 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. - -echo "#!/usr/bin/env bash" > ../source.sh - -project_id=$(terraform output project_id) -echo "export TF_VAR_project_id='$project_id'" >> ../source.sh - -sa_json=$(terraform output sa_key) -# shellcheck disable=SC2086 -echo "export SERVICE_ACCOUNT_JSON='$(echo $sa_json | base64 --decode)'" >> ../source.sh diff --git a/test/setup/versions.tf b/test/setup/versions.tf index 5394826..7c2aee7 100644 --- a/test/setup/versions.tf +++ b/test/setup/versions.tf @@ -15,13 +15,15 @@ */ terraform { - required_version = ">= 0.12" -} - -provider "google" { - version = ">= 3.63" -} - -provider "google-beta" { - version = ">= 3.63" + required_version = ">= 0.13" + required_providers { + google = { + source = "hashicorp/google" + version = ">= 3.63" + } + google-beta = { + source = "hashicorp/google-beta" + version = ">= 3.63" + } + } } diff --git a/versions.tf b/versions.tf index 93f4b03..2bb8576 100644 --- a/versions.tf +++ b/versions.tf @@ -20,11 +20,11 @@ terraform { google = { source = "hashicorp/google" - version = "~> 3.53" + version = ">= 3.53, < 5.0" } google-beta = { source = "hashicorp/google-beta" - version = "~> 3.53" + version = ">= 3.53, < 5.0" } }