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 2022-01-25 10:22:30 +01:00 committed by GitHub
parent d580014c66
commit d64b341b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

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

View File

@ -229,7 +229,7 @@ resource "google_compute_instance" "master" {
# Since we use google_compute_attached_disk we need to ignore this # Since we use google_compute_attached_disk we need to ignore this
lifecycle { 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 # Since we use google_compute_attached_disk we need to ignore this
lifecycle { lifecycle {
ignore_changes = ["attached_disk"] ignore_changes = [attached_disk]
} }
} }

View File

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