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

google_container_cluster data source: read fail with Invalid address to set (...config_connector_config) #13525

Comments

@nemethloci
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

v1.3.7
hashicorp/google provider version: 4.49.0

Affected Resource(s)

  • google_container_cluster (data provider)

Terraform Configuration Files

data "google_container_cluster" "cluster" {
  count    = local.cloud_env == "cpl" ? 0 : 1
  project  = local.project
  location = local.region
  name     = local.cluster_name
}
# Note: variables have been checked and they are defined and their values are correct.

Expected Behavior

terraform should fetch the cluster's data

Actual Behavior

╷
│ Error: Invalid address to set: []string{"addons_config", "0", "config_connector_config"}
│ 
│   with module.global-config.data.google_container_cluster.cluster[0],
│   on .terraform/modules/global-config/main.tf line 28, in data "google_container_cluster" "cluster":
│   28: data "google_container_cluster" "cluster" {
│ 
╵

Steps to Reproduce

terraform {
  required_version = "~> 1.3.7"

  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "~> 4.49.0"
    }
    kubernetes = {
      source  = "hashicorp/kubernetes"
      version = "~> 2.16.1"
    }
  }
}

data "google_container_cluster" "cluster" {
  project  = local.project
  location = local.region
  name     = local.cluster_name
}

Run: terraform plan

Important Factoids

  • based on the error message triggering the issue, might require to have addonsConfig.configConnectorConfig.enabled: true set for the GKE cluster.
  • the very same terraform config works fine just by changing the provider version to 4.48.0 (same config, same cluster....)
@nemethloci nemethloci added the bug label Jan 19, 2023
@robertlindner
Copy link

We are seeing the same issue.
Note: In the api response for our clusters, the config_connector_config is an empty object instead of "enabled": <bool>:

    "addonsConfig": {
        "configConnectorConfig": {},
        "gcePersistentDiskCsiDriverConfig": {
            "enabled": true
        },
        "horizontalPodAutoscaling": {},
        "httpLoadBalancing": {},
        "kubernetesDashboard": {
            "disabled": true
        },
        "networkPolicyConfig": {
            "disabled": true
        }
    },

@oprudkyi
Copy link

seems duplicate to #13507

@rshah28
Copy link

rshah28 commented Jan 20, 2023

I'm running into same issue.

 addons_config {
    config_connector_config {
      enabled = var.enable_config_connector
    }
  }
google = {
      version = "~> 4"
      source  = "hashicorp/google"
    }
    google-beta = {
      version = "~> 4"
      source  = "hashicorp/google-beta"
    }

@edwardmedia edwardmedia self-assigned this Jan 24, 2023
@edwardmedia
Copy link
Contributor

edwardmedia commented Jan 24, 2023

yes dups of
#13507

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.