Skip to content

Commit 4b769ec

Browse files
feat: update TPG version constraints to allow 4.0 (#78)
* feat: update TPG version constraints to allow 4.0 * fix example Co-authored-by: Bharath KKB <[email protected]>
1 parent 70f065e commit 4b769ec

File tree

15 files changed

+195
-41
lines changed

15 files changed

+195
-41
lines changed

examples/instance_with_advanced_options/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
provider "google" {
18-
}
19-
2017
locals {
2118
instance_name = format("%s-%s", var.instance_name, substr(md5(module.gce-advanced-container.container.image), 0, 8))
2219
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
terraform {
18+
required_providers {
19+
google = {
20+
source = "hashicorp/google"
21+
version = "~> 3.53"
22+
}
23+
template = {
24+
source = "hashicorp/template"
25+
version = "~> 2.1"
26+
}
27+
}
28+
required_version = ">= 0.13"
29+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
terraform {
18+
required_providers {
19+
google = {
20+
source = "hashicorp/google"
21+
version = "~> 4.0"
22+
}
23+
}
24+
required_version = ">= 0.13"
25+
}

examples/instance_with_config_file/main.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
provider "google" {
1818
project = var.project_id
19-
version = "~> 3.53"
20-
}
21-
22-
provider "template" {
23-
version = "~> 2.1"
2419
}
2520

2621
locals {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
terraform {
18+
required_providers {
19+
google = {
20+
source = "hashicorp/google"
21+
version = "~> 4.0"
22+
}
23+
template = {
24+
source = "hashicorp/template"
25+
version = "~> 2.1"
26+
}
27+
}
28+
required_version = ">= 0.13"
29+
}

examples/managed_instance_group/main.tf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ locals {
2424
}
2525
provider "google" {
2626
project = var.project_id
27-
version = "~> 3.53.0"
2827
}
2928
provider "google-beta" {
3029
project = var.project_id
31-
version = "~> 3.53.0"
3230
}
3331
module "gce-container" {
3432
source = "../../"
@@ -55,15 +53,15 @@ resource "google_compute_router" "default" {
5553
}
5654
module "cloud-nat" {
5755
source = "terraform-google-modules/cloud-nat/google"
58-
version = "~> 1.0.0"
56+
version = "~> 2.1"
5957
router = google_compute_router.default.name
6058
project_id = var.project_id
6159
region = var.region
6260
name = "${var.network}-cloud-nat-group1"
6361
}
6462
module "mig_template" {
6563
source = "terraform-google-modules/vm/google//modules/instance_template"
66-
version = "~> 6.0"
64+
version = "~> 7.3"
6765
network = google_compute_network.default.self_link
6866
subnetwork = google_compute_subnetwork.default.self_link
6967
service_account = var.service_account
@@ -81,7 +79,7 @@ module "mig_template" {
8179
}
8280
module "mig" {
8381
source = "terraform-google-modules/vm/google//modules/mig"
84-
version = "~> 6.0"
82+
version = "~> 7.3"
8583
instance_template = module.mig_template.self_link
8684
region = var.region
8785
hostname = var.network
@@ -97,7 +95,7 @@ module "mig" {
9795
}
9896
module "http-lb" {
9997
source = "GoogleCloudPlatform/lb-http/google"
100-
version = "~> 4.5"
98+
version = "~> 6.2"
10199

102100
project = var.project_id
103101
name = "${var.mig_name}-lb"
@@ -119,6 +117,7 @@ module "http-lb" {
119117
session_affinity = null
120118
affinity_cookie_ttl_sec = null
121119
custom_request_headers = null
120+
custom_response_headers = null
122121

123122
health_check = {
124123
check_interval_sec = null
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
terraform {
18+
required_providers {
19+
google = {
20+
source = "hashicorp/google"
21+
version = "~> 4.0"
22+
}
23+
google-beta = {
24+
source = "hashicorp/google-beta"
25+
version = "~> 4.0"
26+
}
27+
}
28+
required_version = ">= 0.13"
29+
}

examples/simple_instance/versions.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
terraform {
18+
required_providers {
19+
google = {
20+
source = "hashicorp/google"
21+
version = "~> 4.0"
22+
}
23+
}
24+
required_version = ">= 0.13"
25+
}

modules/cos-coredns/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ terraform {
2020

2121
google = {
2222
source = "hashicorp/google"
23-
version = "~> 3.53"
23+
version = ">= 3.53, < 5.0"
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = "~> 3.53"
27+
version = ">= 3.53, < 5.0"
2828
}
2929
}
3030

modules/cos-generic/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ terraform {
2020

2121
google = {
2222
source = "hashicorp/google"
23-
version = "~> 3.53"
23+
version = ">= 3.53, < 5.0"
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = "~> 3.53"
27+
version = ">= 3.53, < 5.0"
2828
}
2929
}
3030

modules/cos-mysql/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ terraform {
2020

2121
google = {
2222
source = "hashicorp/google"
23-
version = "~> 3.53"
23+
version = ">= 3.53, < 5.0"
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = "~> 3.53"
27+
version = ">= 3.53, < 5.0"
2828
}
2929
}
3030

test/fixtures/instance_with_config_file/provider.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,3 @@
1717
provider "google" {
1818
project = var.project_id
1919
}
20-
21-
provider "local" {
22-
version = "~> 1.4"
23-
}
24-
25-
provider "random" {
26-
version = "~> 2.3"
27-
}
28-
29-
provider "tls" {
30-
version = "~> 2.2"
31-
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
terraform {
18+
required_providers {
19+
google = {
20+
source = "hashicorp/google"
21+
}
22+
local = {
23+
source = "hashicorp/local"
24+
version = "~> 1.4"
25+
}
26+
random = {
27+
source = "hashicorp/random"
28+
version = "~> 2.3"
29+
}
30+
tls = {
31+
source = "hashicorp/tls"
32+
version = "~> 2.2"
33+
}
34+
}
35+
required_version = ">= 0.13"
36+
}

test/setup/versions.tf

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
terraform {
1818
required_version = ">= 0.13"
19-
}
20-
21-
provider "google" {
22-
version = "~> 3.53.0"
23-
}
24-
25-
provider "google-beta" {
26-
version = "~> 3.53.0"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 3.53.0"
23+
}
24+
google-beta = {
25+
source = "hashicorp/google-beta"
26+
version = "~> 3.53.0"
27+
}
28+
}
2729
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ terraform {
2020

2121
google = {
2222
source = "hashicorp/google"
23-
version = "~> 3.53"
23+
version = ">= 3.53, < 5.0"
2424
}
2525
}
2626

0 commit comments

Comments
 (0)