Skip to content

Commit

Permalink
feat: update TPG version constraints to allow 4.0 (#78)
Browse files Browse the repository at this point in the history
* feat: update TPG version constraints to allow 4.0

* fix example

Co-authored-by: Bharath KKB <[email protected]>
  • Loading branch information
cloud-foundation-bot and bharathkkb authored Jan 25, 2022
1 parent 70f065e commit 4b769ec
Show file tree
Hide file tree
Showing 15 changed files with 195 additions and 41 deletions.
3 changes: 0 additions & 3 deletions examples/instance_with_advanced_options/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
* limitations under the License.
*/

provider "google" {
}

locals {
instance_name = format("%s-%s", var.instance_name, substr(md5(module.gce-advanced-container.container.image), 0, 8))
}
Expand Down
29 changes: 29 additions & 0 deletions examples/instance_with_advanced_options/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* 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 = "~> 3.53"
}
template = {
source = "hashicorp/template"
version = "~> 2.1"
}
}
required_version = ">= 0.13"
}
25 changes: 25 additions & 0 deletions examples/instance_with_attached_disk/versions.tf
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 0 additions & 5 deletions examples/instance_with_config_file/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

provider "google" {
project = var.project_id
version = "~> 3.53"
}

provider "template" {
version = "~> 2.1"
}

locals {
Expand Down
29 changes: 29 additions & 0 deletions examples/instance_with_config_file/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* 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"
}
template = {
source = "hashicorp/template"
version = "~> 2.1"
}
}
required_version = ">= 0.13"
}
11 changes: 5 additions & 6 deletions examples/managed_instance_group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ locals {
}
provider "google" {
project = var.project_id
version = "~> 3.53.0"
}
provider "google-beta" {
project = var.project_id
version = "~> 3.53.0"
}
module "gce-container" {
source = "../../"
Expand All @@ -55,15 +53,15 @@ resource "google_compute_router" "default" {
}
module "cloud-nat" {
source = "terraform-google-modules/cloud-nat/google"
version = "~> 1.0.0"
version = "~> 2.1"
router = google_compute_router.default.name
project_id = var.project_id
region = var.region
name = "${var.network}-cloud-nat-group1"
}
module "mig_template" {
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 6.0"
version = "~> 7.3"
network = google_compute_network.default.self_link
subnetwork = google_compute_subnetwork.default.self_link
service_account = var.service_account
Expand All @@ -81,7 +79,7 @@ module "mig_template" {
}
module "mig" {
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 6.0"
version = "~> 7.3"
instance_template = module.mig_template.self_link
region = var.region
hostname = var.network
Expand All @@ -97,7 +95,7 @@ module "mig" {
}
module "http-lb" {
source = "GoogleCloudPlatform/lb-http/google"
version = "~> 4.5"
version = "~> 6.2"

project = var.project_id
name = "${var.mig_name}-lb"
Expand All @@ -119,6 +117,7 @@ module "http-lb" {
session_affinity = null
affinity_cookie_ttl_sec = null
custom_request_headers = null
custom_response_headers = null

health_check = {
check_interval_sec = null
Expand Down
29 changes: 29 additions & 0 deletions examples/managed_instance_group/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* 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"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.0"
}
}
required_version = ">= 0.13"
}
25 changes: 25 additions & 0 deletions examples/simple_instance/versions.tf
Original file line number Diff line number Diff line change
@@ -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"
}
4 changes: 2 additions & 2 deletions modules/cos-coredns/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/cos-generic/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/cos-mysql/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down
12 changes: 0 additions & 12 deletions test/fixtures/instance_with_config_file/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,3 @@
provider "google" {
project = var.project_id
}

provider "local" {
version = "~> 1.4"
}

provider "random" {
version = "~> 2.3"
}

provider "tls" {
version = "~> 2.2"
}
36 changes: 36 additions & 0 deletions test/fixtures/instance_with_config_file/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* 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"
}
local = {
source = "hashicorp/local"
version = "~> 1.4"
}
random = {
source = "hashicorp/random"
version = "~> 2.3"
}
tls = {
source = "hashicorp/tls"
version = "~> 2.2"
}
}
required_version = ">= 0.13"
}
18 changes: 10 additions & 8 deletions test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

terraform {
required_version = ">= 0.13"
}

provider "google" {
version = "~> 3.53.0"
}

provider "google-beta" {
version = "~> 3.53.0"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.53.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 3.53.0"
}
}
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ terraform {

google = {
source = "hashicorp/google"
version = "~> 3.53"
version = ">= 3.53, < 5.0"
}
}

Expand Down

0 comments on commit 4b769ec

Please sign in to comment.