Browse Source

Update terraform GCP to Ubuntu 20.04 (latest LTS) (#8463)

* Fix terraform Warning

Version constraints inside provider configuration blocks are deprecated

Terraform 0.13 and earlier allowed provider version constraints inside the
provider configuration block, but that is now deprecated and will be removed
in a future version of Terraform. To silence this warning, move the provider
version constraint into the required_providers block.

* Fix terraform Warning: Quoted references are deprecated

* terraform: Update GCP Ubuntu to latest LTS
pull/8470/head
Mathieu Parent 2 years ago
committed by GitHub
parent
commit
d64b341b38
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions
  1. 10
      contrib/terraform/gcp/main.tf
  2. 4
      contrib/terraform/gcp/modules/kubernetes-cluster/main.tf
  3. 6
      contrib/terraform/gcp/tfvars.json

10
contrib/terraform/gcp/main.tf

@ -1,8 +1,16 @@
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.48"
}
}
}
provider "google" {
credentials = file(var.keyfile_location)
region = var.region
project = var.gcp_project_id
version = "~> 3.48"
}
module "kubernetes" {

4
contrib/terraform/gcp/modules/kubernetes-cluster/main.tf

@ -229,7 +229,7 @@ resource "google_compute_instance" "master" {
# Since we use google_compute_attached_disk we need to ignore this
lifecycle {
ignore_changes = ["attached_disk"]
ignore_changes = [attached_disk]
}
}
@ -326,7 +326,7 @@ resource "google_compute_instance" "worker" {
# Since we use google_compute_attached_disk we need to ignore this
lifecycle {
ignore_changes = ["attached_disk"]
ignore_changes = [attached_disk]
}
}

6
contrib/terraform/gcp/tfvars.json

@ -24,7 +24,7 @@
"zone": "us-central1-a",
"additional_disks": {},
"boot_disk": {
"image_name": "ubuntu-os-cloud/ubuntu-1804-bionic-v20201116",
"image_name": "ubuntu-os-cloud/ubuntu-2004-focal-v20220118",
"size": 50
}
},
@ -38,7 +38,7 @@
}
},
"boot_disk": {
"image_name": "ubuntu-os-cloud/ubuntu-1804-bionic-v20201116",
"image_name": "ubuntu-os-cloud/ubuntu-2004-focal-v20220118",
"size": 50
}
},
@ -52,7 +52,7 @@
}
},
"boot_disk": {
"image_name": "ubuntu-os-cloud/ubuntu-1804-bionic-v20201116",
"image_name": "ubuntu-os-cloud/ubuntu-2004-focal-v20220118",
"size": 50
}
}

Loading…
Cancel
Save