Skip to content

Commit 71aa344

Browse files
feat: update TPG version constraints to allow 4.0 (#133)
* feat: update TPG version constraints to allow 4.0 * bump dep modules * pin pf to minor Co-authored-by: bharathkkb <bharathkrishnakb@gmail.com>
1 parent a7f39a9 commit 71aa344

File tree

11 files changed

+126
-59
lines changed

11 files changed

+126
-59
lines changed

examples/cloudbuild_enabled/main.tf

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

17-
18-
provider "google" {
19-
version = ">= 3.50"
20-
}
21-
22-
provider "google-beta" {
23-
version = ">= 3.50"
24-
}
25-
26-
provider "null" {
27-
version = "~> 2.1"
28-
}
29-
30-
provider "random" {
31-
version = "~> 2.2"
32-
}
33-
3417
/*************************************************
3518
Bootstrap GCP Organization.
3619
*************************************************/
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
null = {
28+
source = "hashicorp/null"
29+
version = "~> 2.1"
30+
}
31+
random = {
32+
source = "hashicorp/random"
33+
version = "~> 2.2"
34+
}
35+
}
36+
required_version = ">= 0.13"
37+
}

examples/simple-folder/main.tf

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

17-
provider "google" {
18-
version = ">= 3.50"
19-
}
20-
21-
provider "null" {
22-
version = "~> 2.1"
23-
}
24-
25-
provider "random" {
26-
version = "~> 2.2"
27-
}
28-
2917
/*************************************************
3018
Bootstrap GCP Folder.
3119
*************************************************/

examples/simple-folder/versions.tf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
null = {
24+
source = "hashicorp/null"
25+
version = "~> 2.1"
26+
}
27+
random = {
28+
source = "hashicorp/random"
29+
version = "~> 2.2"
30+
}
31+
}
32+
required_version = ">= 0.13"
33+
}

examples/simple/main.tf

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

17-
provider "google" {
18-
version = ">= 3.50"
19-
}
20-
21-
provider "null" {
22-
version = "~> 2.1"
23-
}
24-
25-
provider "random" {
26-
version = "~> 2.2"
27-
}
28-
2917
/*************************************************
3018
Bootstrap GCP Organization.
3119
*************************************************/

examples/simple/versions.tf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
null = {
24+
source = "hashicorp/null"
25+
version = "~> 2.1"
26+
}
27+
random = {
28+
source = "hashicorp/random"
29+
version = "~> 2.2"
30+
}
31+
}
32+
required_version = ">= 0.13"
33+
}

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ resource "google_folder_iam_member" "tmp_project_creator" {
5656

5757
module "seed_project" {
5858
source = "terraform-google-modules/project-factory/google"
59-
version = "~> 11.2"
59+
version = "~> 11.3"
6060
name = local.seed_project_id
6161
random_project_id = var.random_suffix
6262
disable_services_on_destroy = false
@@ -93,7 +93,7 @@ data "google_storage_project_service_account" "gcs_account" {
9393
module "kms" {
9494
count = var.encrypt_gcs_bucket_tfstate ? 1 : 0
9595
source = "terraform-google-modules/kms/google"
96-
version = "~> 1.2"
96+
version = "~> 2.1"
9797

9898
project_id = module.seed_project.project_id
9999
location = var.default_region

modules/cloudbuild/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ data "google_organization" "org" {
3939

4040
module "cloudbuild_project" {
4141
source = "terraform-google-modules/project-factory/google"
42-
version = "~> 11.2"
42+
version = "~> 11.3"
4343
name = local.cloudbuild_project_id
4444
random_project_id = var.random_suffix
4545
disable_services_on_destroy = false
@@ -97,15 +97,15 @@ resource "google_kms_key_ring" "tf_keyring" {
9797

9898
resource "google_kms_crypto_key" "tf_key" {
9999
name = "tf-key"
100-
key_ring = google_kms_key_ring.tf_keyring.self_link
100+
key_ring = google_kms_key_ring.tf_keyring.id
101101
}
102102

103103
/******************************************
104104
Permissions to decrypt.
105105
*****************************************/
106106

107107
resource "google_kms_crypto_key_iam_binding" "cloudbuild_crypto_key_decrypter" {
108-
crypto_key_id = google_kms_crypto_key.tf_key.self_link
108+
crypto_key_id = google_kms_crypto_key.tf_key.id
109109
role = "roles/cloudkms.cryptoKeyDecrypter"
110110

111111
members = [
@@ -119,7 +119,7 @@ resource "google_kms_crypto_key_iam_binding" "cloudbuild_crypto_key_decrypter" {
119119
*****************************************/
120120

121121
resource "google_kms_crypto_key_iam_binding" "cloud_build_crypto_key_encrypter" {
122-
crypto_key_id = google_kms_crypto_key.tf_key.self_link
122+
crypto_key_id = google_kms_crypto_key.tf_key.id
123123
role = "roles/cloudkms.cryptoKeyEncrypter"
124124

125125
members = [

modules/cloudbuild/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ terraform {
2020
required_providers {
2121
google = {
2222
source = "hashicorp/google"
23-
version = ">= 3.50"
23+
version = ">= 3.50, < 5.0"
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = ">= 3.50"
27+
version = ">= 3.50, < 5.0"
2828
}
2929
}
3030

test/setup/versions.tf

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">= 0.12"
19-
}
20-
21-
provider "google" {
22-
version = "~> 3.31"
23-
}
24-
25-
provider "google-beta" {
26-
version = "~> 3.31"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 3.31"
23+
}
24+
google-beta = {
25+
source = "hashicorp/google-beta"
26+
version = "~> 3.31"
27+
}
28+
random = {
29+
source = "hashicorp/random"
30+
}
31+
}
2732
}

0 commit comments

Comments
 (0)