From 2d39ed989b09841aacc738121d0909f5e94efa22 Mon Sep 17 00:00:00 2001 From: cloud-foundation-bot <60107303+cloud-foundation-bot@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:20:08 -0600 Subject: [PATCH] feat: update TPG version constraints to allow 4.0 (#52) --- examples/basic_org_policies/versions.tf | 25 +++++++++++++++++++ examples/boolean_org_exclude/main.tf | 7 ------ examples/boolean_org_exclude/versions.tf | 25 +++++++++++++++++++ examples/boolean_project_allow/main.tf | 7 ------ examples/boolean_project_allow/versions.tf | 25 +++++++++++++++++++ examples/list_folder_deny/main.tf | 7 ------ examples/list_folder_deny/versions.tf | 25 +++++++++++++++++++ examples/list_org_exclude/main.tf | 7 ------ examples/list_org_exclude/versions.tf | 25 +++++++++++++++++++ modules/bucket_policy_only/versions.tf | 2 +- modules/domain_restricted_sharing/versions.tf | 2 +- modules/restrict_vm_external_ips/versions.tf | 2 +- modules/skip_default_network/versions.tf | 2 +- test/setup/versions.tf | 20 ++++++++------- versions.tf | 2 +- 15 files changed, 141 insertions(+), 42 deletions(-) create mode 100644 examples/basic_org_policies/versions.tf create mode 100644 examples/boolean_org_exclude/versions.tf create mode 100644 examples/boolean_project_allow/versions.tf create mode 100644 examples/list_folder_deny/versions.tf create mode 100644 examples/list_org_exclude/versions.tf diff --git a/examples/basic_org_policies/versions.tf b/examples/basic_org_policies/versions.tf new file mode 100644 index 0000000..37a1c11 --- /dev/null +++ b/examples/basic_org_policies/versions.tf @@ -0,0 +1,25 @@ +/** + * 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. + * 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. + */ + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + } + required_version = ">= 0.13" +} diff --git a/examples/boolean_org_exclude/main.tf b/examples/boolean_org_exclude/main.tf index 4f0fcfd..977ec47 100644 --- a/examples/boolean_org_exclude/main.tf +++ b/examples/boolean_org_exclude/main.tf @@ -14,13 +14,6 @@ * limitations under the License. */ -/****************************************** - Provider configuration - *****************************************/ -provider "google" { - version = "~> 3.53" -} - /****************************************** Apply the constraint using the module *****************************************/ diff --git a/examples/boolean_org_exclude/versions.tf b/examples/boolean_org_exclude/versions.tf new file mode 100644 index 0000000..37a1c11 --- /dev/null +++ b/examples/boolean_org_exclude/versions.tf @@ -0,0 +1,25 @@ +/** + * 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. + * 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. + */ + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + } + required_version = ">= 0.13" +} diff --git a/examples/boolean_project_allow/main.tf b/examples/boolean_project_allow/main.tf index 943fdbd..208e839 100644 --- a/examples/boolean_project_allow/main.tf +++ b/examples/boolean_project_allow/main.tf @@ -14,13 +14,6 @@ * limitations under the License. */ -/****************************************** - Provider configuration - *****************************************/ -provider "google" { - version = "~> 3.53" -} - /****************************************** Apply the constraint using the module *****************************************/ diff --git a/examples/boolean_project_allow/versions.tf b/examples/boolean_project_allow/versions.tf new file mode 100644 index 0000000..37a1c11 --- /dev/null +++ b/examples/boolean_project_allow/versions.tf @@ -0,0 +1,25 @@ +/** + * 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. + * 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. + */ + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + } + required_version = ">= 0.13" +} diff --git a/examples/list_folder_deny/main.tf b/examples/list_folder_deny/main.tf index bf0632d..9e1ac4d 100644 --- a/examples/list_folder_deny/main.tf +++ b/examples/list_folder_deny/main.tf @@ -14,13 +14,6 @@ * limitations under the License. */ -/****************************************** - Provider configuration - *****************************************/ -provider "google" { - version = "~> 3.53" -} - /****************************************** Apply the constraint using the module *****************************************/ diff --git a/examples/list_folder_deny/versions.tf b/examples/list_folder_deny/versions.tf new file mode 100644 index 0000000..37a1c11 --- /dev/null +++ b/examples/list_folder_deny/versions.tf @@ -0,0 +1,25 @@ +/** + * 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. + * 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. + */ + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + } + required_version = ">= 0.13" +} diff --git a/examples/list_org_exclude/main.tf b/examples/list_org_exclude/main.tf index fc873b6..c07727a 100644 --- a/examples/list_org_exclude/main.tf +++ b/examples/list_org_exclude/main.tf @@ -14,13 +14,6 @@ * limitations under the License. */ -/****************************************** - Provider configuration - *****************************************/ -provider "google" { - version = "~> 3.53" -} - /****************************************** Apply the constraint using the module *****************************************/ diff --git a/examples/list_org_exclude/versions.tf b/examples/list_org_exclude/versions.tf new file mode 100644 index 0000000..37a1c11 --- /dev/null +++ b/examples/list_org_exclude/versions.tf @@ -0,0 +1,25 @@ +/** + * 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. + * 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. + */ + +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.0" + } + } + required_version = ">= 0.13" +} diff --git a/modules/bucket_policy_only/versions.tf b/modules/bucket_policy_only/versions.tf index 74c4dc8..5af3fd0 100644 --- a/modules/bucket_policy_only/versions.tf +++ b/modules/bucket_policy_only/versions.tf @@ -20,7 +20,7 @@ terraform { google = { source = "hashicorp/google" - version = "~> 3.53" + version = ">= 3.53, < 5.0" } } diff --git a/modules/domain_restricted_sharing/versions.tf b/modules/domain_restricted_sharing/versions.tf index b351ae5..b5a1676 100644 --- a/modules/domain_restricted_sharing/versions.tf +++ b/modules/domain_restricted_sharing/versions.tf @@ -20,7 +20,7 @@ terraform { google = { source = "hashicorp/google" - version = "~> 3.53" + version = ">= 3.53, < 5.0" } } diff --git a/modules/restrict_vm_external_ips/versions.tf b/modules/restrict_vm_external_ips/versions.tf index dc36e72..a20e577 100644 --- a/modules/restrict_vm_external_ips/versions.tf +++ b/modules/restrict_vm_external_ips/versions.tf @@ -20,7 +20,7 @@ terraform { google = { source = "hashicorp/google" - version = "~> 3.53" + version = ">= 3.53, < 5.0" } } diff --git a/modules/skip_default_network/versions.tf b/modules/skip_default_network/versions.tf index c2e1cc7..8a250f4 100644 --- a/modules/skip_default_network/versions.tf +++ b/modules/skip_default_network/versions.tf @@ -20,7 +20,7 @@ terraform { google = { source = "hashicorp/google" - version = "~> 3.53" + version = ">= 3.53, < 5.0" } } diff --git a/test/setup/versions.tf b/test/setup/versions.tf index f488346..1bdf898 100644 --- a/test/setup/versions.tf +++ b/test/setup/versions.tf @@ -15,13 +15,15 @@ */ terraform { - required_version = ">=0.12.6" -} - -provider "google" { - version = "~> 3.53.0" -} - -provider "google-beta" { - version = "~> 3.53.0" + required_version = ">= 0.13" + required_providers { + google = { + source = "hashicorp/google" + version = "~> 3.53.0" + } + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.53.0" + } + } } diff --git a/versions.tf b/versions.tf index f318b17..6788bc2 100644 --- a/versions.tf +++ b/versions.tf @@ -20,7 +20,7 @@ terraform { google = { source = "hashicorp/google" - version = "~> 3.53" + version = ">= 3.53, < 5.0" } }