From 19ee57dc04d8b929800fee6a154618b4694bc120 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 13 Nov 2019 17:31:11 -0800 Subject: [PATCH] Use GCP region_instance_group_manager version block format * terraform-provider-google v2.19.0 deprecates `instance_template` within `google_compute_region_instance_group_manager` in order to support a scheme with multiple version blocks. Adapt our single version to the new format to resolve deprecation warnings. * Fixes: Warning: "instance_template": [DEPRECATED] This field will be replaced by `version.instance_template` in 3.0.0 * Require terraform-provider-google v2.19.0+ (action required) --- CHANGES.md | 6 ++++++ google-cloud/container-linux/kubernetes/versions.tf | 8 ++++---- .../container-linux/kubernetes/workers/workers.tf | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fb099950..c6144af6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,12 @@ Notable changes between versions. * Replace usage of `template_dir` with `templatefile` function ([#587](https://github.com/poseidon/typhoon/pull/587)) * Require Terraform version v0.12.6+ (action required) +#### Google + +* Use new `google_compute_region_instance_group_manager` version block format + * Fixes warning that `instance_template` is deprecated + * Require `terraform-provider-google` v2.19.0+ (action required) + ## v1.16.3 * Kubernetes [v1.16.3](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.16.md#v1163) diff --git a/google-cloud/container-linux/kubernetes/versions.tf b/google-cloud/container-linux/kubernetes/versions.tf index 1ebc23a3..f28854f9 100644 --- a/google-cloud/container-linux/kubernetes/versions.tf +++ b/google-cloud/container-linux/kubernetes/versions.tf @@ -3,9 +3,9 @@ terraform { required_version = "~> 0.12.6" required_providers { - google = "~> 2.5" - ct = "~> 0.3" - template = "~> 2.1" - null = "~> 2.1" + google = "~> 2.19" + ct = "~> 0.3" + template = "~> 2.1" + null = "~> 2.1" } } diff --git a/google-cloud/container-linux/kubernetes/workers/workers.tf b/google-cloud/container-linux/kubernetes/workers/workers.tf index 83eea948..0c0b8ba2 100644 --- a/google-cloud/container-linux/kubernetes/workers/workers.tf +++ b/google-cloud/container-linux/kubernetes/workers/workers.tf @@ -5,8 +5,11 @@ resource "google_compute_region_instance_group_manager" "workers" { # instance name prefix for instances in the group base_instance_name = "${var.name}-worker" - instance_template = google_compute_instance_template.worker.self_link region = var.region + version { + name = "default" + instance_template = google_compute_instance_template.worker.self_link + } target_size = var.worker_count target_pools = [google_compute_target_pool.workers.self_link]