You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to see the cluster imported correctly.
Observed behavior
╷
│ Error: Invalid index
│
│ on .terraform/modules/gke/main.tf line 114, in locals:
│ 114: cluster_output_http_load_balancing_enabled = google_container_cluster.primary.addons_config[0].http_load_balancing[0].disabled
│ ├────────────────
│ │ google_container_cluster.primary.addons_config[0].http_load_balancing is empty list of object
│
│ The given key does not identify an element in this collection value: the collection has no elements.
╵
╷
│ Error: Invalid index
│
│ on .terraform/modules/gke/main.tf line 115, in locals:
│ 115: cluster_output_horizontal_pod_autoscaling_enabled = google_container_cluster.primary.addons_config[0].horizontal_pod_autoscaling[0].disabled
│ ├────────────────
│ │ google_container_cluster.primary.addons_config[0].horizontal_pod_autoscaling is empty list of object
│
│ The given key does not identify an element in this collection value: the collection has no elements.
mazzy89
changed the title
Import of existing cluster fails due to addons empty
Import of existing cluster fails due to addons response empty
Aug 23, 2023
I have found something interesting in the GKE documentation
GKE clusters have HTTP load balancing enabled by default; you must not disable it.
Having http enabled by default I guess they do not expose it via the API. At this point still make sense to have it exposed as a boolean flag in this module?
I was able to import successfully the cluster by pulling the module and commenting out the offending Terraform blocks. The import then run successfully. After that I've replaced again the module with the upstream one and it worked. Hope it helps for whoever will come next.
TL;DR
Importing an existing cluster fails due to the addons JSON response empty from gcloud CLI.
Expected behavior
I would like to see the cluster imported correctly.
Observed behavior
Terraform Configuration
Terraform Version
Additional information
A similar issue (#494) was reported but in that occasion the user could at least import. I'm not even able to import.
The text was updated successfully, but these errors were encountered: