Skip to content

Commit af7347b

Browse files
feat: update TPG version constraints to allow 4.0 (#215)
* feat: update TPG version constraints to allow 4.0 * Loosens Google provider constraints * breaking changes in 4.0 are k8s-specific * Updates template * Replaces self_link with id * Corrects documentation Co-authored-by: cloud-foundation-bot <[email protected]>
1 parent 9e48c1f commit af7347b

File tree

50 files changed

+197
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+197
-108
lines changed

autogen/versions.tf.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
terraform {
1818
required_version = ">=0.13.0"
1919
required_providers {
20-
google = ">= 3.43, <4.0"
21-
google-beta = ">= 3.43, <4.0"
20+
google = ">= 3.43, < 5.0"
21+
google-beta = ">= 3.43, < 5.0"
2222
}
2323
provider_meta "google" {
2424
module_name = "blueprints/terraform/terraform-google-vm:{% if mig %}mig{% else %}mig_with_percent{% endif %}/v7.2.0"

examples/compute_instance/disk_snapshot/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
provider "google" {
18-
version = "~> 3.0"
19-
}
20-
2117
# Building the list of disk names in the required format.
2218
# Usually you would build this list from the outputs of the compute_instance module
2319
locals {

examples/compute_instance/disk_snapshot/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
}
1925
}

examples/compute_instance/multiple_interfaces/main.tf

-11
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
terraform {
18-
required_providers {
19-
google = {
20-
version = ">= 3.45.0"
21-
}
22-
null = {
23-
version = ">= 2.1.0"
24-
}
25-
}
26-
}
27-
2817
# [START compute_vm_with_multiple_interface]
2918
resource "google_compute_instance" "default" {
3019
project = var.project_id # Replace with your project ID in quotes

examples/compute_instance/multiple_interfaces/versions.tf

+11-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,15 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
null = {
25+
source = "hashicorp/null"
26+
version = ">= 2.1.0"
27+
}
28+
}
1929
}

examples/compute_instance/next_hop/main.tf

-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
provider "google" {
18-
19-
version = "~> 3.0"
20-
}
21-
2217
# [START compute_vm_as_next_hop_create]
2318
resource "google_compute_instance" "default" {
2419
project = var.project_id # Replace this with your project ID in quotes

examples/compute_instance/next_hop/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
}
1925
}

examples/compute_instance/simple/main.tf

-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
provider "google" {
18-
19-
version = "~> 3.0"
20-
}
21-
2217
module "instance_template" {
2318
source = "../../../modules/instance_template"
2419
region = var.region

examples/compute_instance/simple/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
}
1925
}

examples/compute_instance/tags/main.tf

-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
provider "google" {
18-
19-
version = "~> 3.0"
20-
}
21-
2217
# [START compute_vm_with_tags_create]
2318
resource "google_compute_instance" "default" {
2419
project = var.project_id # Replace this with your project ID in quotes

examples/compute_instance/tags/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
}
1925
}

examples/instance_template/additional_disks/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ provider "google" {
1818

1919
project = var.project_id
2020
region = var.region
21-
version = "~> 3.0"
2221
}
2322

2423
module "instance_template" {

examples/instance_template/additional_disks/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
}
1925
}

examples/instance_template/alias_ip_range/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ provider "google" {
1818

1919
project = var.project_id
2020
region = var.region
21-
version = "~> 3.0"
2221
}
2322

2423
resource "google_compute_address" "ip_address" {

examples/instance_template/alias_ip_range/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
}
1925
}

examples/instance_template/encrypted_disks/main.tf

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ provider "google" {
1818

1919
project = var.project_id
2020
region = var.region
21-
version = "~> 3.0"
2221
}
2322

2423
resource "google_kms_key_ring" "keyring" {
@@ -43,7 +42,7 @@ module "instance_template" {
4342
service_account = var.service_account
4443
name_prefix = "additional-disks"
4544

46-
disk_encryption_key = google_kms_crypto_key.example-key.self_link
45+
disk_encryption_key = google_kms_crypto_key.example-key.id
4746

4847
additional_disks = [
4948
{

examples/instance_template/encrypted_disks/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
}
1925
}

examples/instance_template/simple/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ provider "google" {
1818

1919
project = var.project_id
2020
region = var.region
21-
version = "~> 3.0"
2221
}
2322

2423
resource "google_compute_address" "ip_address" {

examples/instance_template/simple/versions.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
}
1925
}

examples/mig/autoscaler/main.tf

-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ provider "google" {
1818

1919
project = var.project_id
2020
region = var.region
21-
version = "~>3.0"
2221
}
2322

2423
provider "google-beta" {
2524

2625
project = var.project_id
2726
region = var.region
28-
version = "~> 3.0"
2927
}
3028

3129
module "instance_template" {

examples/mig/autoscaler/versions.tf

+11-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,15 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
google-beta = {
25+
source = "hashicorp/google-beta"
26+
version = "~> 4.0"
27+
}
28+
}
1929
}

examples/mig/full/main.tf

-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ provider "google" {
1818

1919
project = var.project_id
2020
region = var.region
21-
version = "~>3.0"
2221
}
2322

2423
provider "google-beta" {
2524

2625
project = var.project_id
2726
region = var.region
28-
version = "~> 3.0"
2927
}
3028

3129
module "instance_template" {

examples/mig/full/versions.tf

+11-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,15 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
google-beta = {
25+
source = "hashicorp/google-beta"
26+
version = "~> 4.0"
27+
}
28+
}
1929
}

examples/mig/healthcheck/main.tf

-8
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,11 @@
1919
provider "google" {
2020
project = var.project_id
2121
region = var.region
22-
version = "~>3.0"
2322
}
2423

2524
provider "google-beta" {
2625
project = var.project_id
2726
region = var.region
28-
version = "~> 3.0"
29-
}
30-
31-
/** Random String (optional) **/
32-
33-
provider "random" {
34-
version = "~> 2.2"
3527
}
3628

3729
resource "random_string" "suffix" {

examples/mig/healthcheck/versions.tf

+15-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,19 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
google-beta = {
25+
source = "hashicorp/google-beta"
26+
version = "~> 4.0"
27+
}
28+
random = {
29+
source = "hashicorp/random"
30+
version = "~> 2.2"
31+
}
32+
}
1933
}

examples/mig/simple/main.tf

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616

1717
provider "google" {
1818

19-
region = var.region
20-
version = "~> 3.0"
19+
region = var.region
2120
}
2221

2322
provider "google-beta" {
2423

25-
region = var.region
26-
version = "~> 3.0"
24+
region = var.region
2725
}
2826

2927
module "instance_template" {

examples/mig/simple/versions.tf

+11-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,15 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.12.6"
18+
required_version = ">= 0.13"
19+
required_providers {
20+
google = {
21+
source = "hashicorp/google"
22+
version = "~> 4.0"
23+
}
24+
google-beta = {
25+
source = "hashicorp/google-beta"
26+
version = "~> 4.0"
27+
}
28+
}
1929
}

examples/mig_with_percent/simple/main.tf

-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ provider "google" {
1818

1919
project = var.project_id
2020
region = var.region
21-
version = "~> 3.0"
2221
}
2322

2423
provider "google-beta" {
2524

2625
project = var.project_id
2726
region = var.region
28-
version = "~> 3.0"
2927
}
3028

3129
module "preemptible_and_regular_instance_templates" {

0 commit comments

Comments
 (0)