Terraform zone : [DEPRECATED] Use location instead, but location results in another error. Any solution?

11/30/2019

When I try with zone, I get "Zone deprecated, use location instead", but, location is not recognized.

Is there any workaround?

provider "google" {
  credentials = file("gcp-terra-flask-CREDENTIALS_FILE.json")
  project = "gcp-terra-flask"
  region  = "us-west1"
  zone    = "us-west1-a"
  version = "~> 2.17.0"
}


provider "google" {
  credentials = file("gcp-terra-flask-CREDENTIALS_FILE.json")
  project = "gcp-terra-flask"
  region  = "us-west1"
  location    = "us-west1-a"
  version = "~> 2.17.0"
}

I tried the below example. Used brew "upgrade terraform". I need to figure out what changes I need to make so this one runs without any Warning, without any errors (assuming all gce permissions are in line).

https://cloud.google.com/community/tutorials/getting-started-on-gcp-with-terraform

-- Espresso
google-kubernetes-engine
terraform

1 Answer

11/30/2019

Hi your problem is with the version 3.. See https://www.terraform.io/docs/providers/google/guides/version_3_upgrade.html

That is in beta and all of us that only set a minimal version are caching the beta version for this provider.

For bigquery I need to set the provider for the last 2.. Version :(

See as example: https://github.com/forseti-security/terraform-google-forseti/issues/303

-- Abel Matos
Source: StackOverflow