Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: var.zones is empty list of string #370

Closed
naseemkullah opened this issue Dec 6, 2019 · 4 comments
Closed

Error: var.zones is empty list of string #370

naseemkullah opened this issue Dec 6, 2019 · 4 comments

Comments

@naseemkullah
Copy link
Contributor

Although I'm able to create clusters just fine, when I try to import a non related resource into a non related module within the same root directory, I get:

Error: Invalid index

  on .terraform/modules/gke_us_central.gke/terraform-google-modules-terraform-google-kubernetes-engine-3212e3b/modules/beta-public-cluster/main.tf line 37, in locals:
  37:   region   = var.region == null ? join("-", slice(split("-", var.zones[0]), 0, 2)) : var.region
    |----------------
    | var.zones is empty list of string

The given key does not identify an element in this collection value.

As you may notice, I am using a thin wrapper around the beta-public-cluster module, I pass in the value of zones in this wrapper, which is a 1 element array of zones.

Any idea what may be going on?

@naseemkullah
Copy link
Contributor Author

naseemkullah commented Dec 6, 2019

The workaround was to comment out the various thin-wrapper-around-this-module
module instantiations, import the non-related resource, then uncomment the modules.

If there is any further insight as to what might be happening please let me know, if not feel free to close this issue.

@morgante
Copy link
Contributor

morgante commented Dec 6, 2019

I'm not really sure what could be causing this, I suspect it might be related to the pass-through.

Closing for now, but if anyone else encounters it we can reopen and investigate.

@morgante morgante closed this as completed Dec 6, 2019
@omazin
Copy link
Contributor

omazin commented Dec 10, 2019

#294

@jamesthimont
Copy link

@morgante in safer-cluster-update-variant/main.tf the zones entry below is missing

module "gke" {
  source             = "../beta-private-cluster-update-variant/"
  project_id         = var.project_id
  name               = var.name
  regional           = var.regional
  region             = var.region
  ***zones              = var.zones***
  network            = var.network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants