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

Issues running a plan with asm module if cluster is not created yet #1364

Closed
DP19 opened this issue Aug 20, 2022 · 2 comments · Fixed by #1365
Closed

Issues running a plan with asm module if cluster is not created yet #1364

DP19 opened this issue Aug 20, 2022 · 2 comments · Fixed by #1365
Labels
bug Something isn't working

Comments

@DP19
Copy link
Contributor

DP19 commented Aug 20, 2022

TL;DR

Running a plan currently causes the same error seen in terraform-google-modules/terraform-google-gcloud#82

Even with the changes added in #1354

If we remove the depends_on from the asm module call leaving only the module_depends_on we get an error about the google_container_cluster.asm.id being null

  on .terraform/modules/gke_cluster_jobs.kubernetes_engine_asm/modules/asm/hub.tf line 24, in resource "google_gke_hub_membership" "membership":
  24:       resource_link = "//container.googleapis.com/${data.google_container_cluster.asm.id}"
    |----------------
    | data.google_container_cluster.asm.id is null

can we also add a depends_on block to this data resource? Adding this in manually to my locally copied version of the asm module produces a plan correctly

Expected behavior

No response

Observed behavior

No response

Terraform Configuration

module "kubernetes_engine_asm" {
  module_depends_on         = [module.gke_cluster]
  source                    = "terraform-google-modules/kubernetes-engine/google//modules/asm"
  version                   = "22.1.0"
  project_id                = var.project_name
  channel                   = lower(var.release_channel)
  cluster_location          = var.cluster_location
  cluster_name              = var.cluster_name
  enable_cni                = true
  enable_fleet_registration = true
  enable_mesh_feature       = true
}
module "gke_cluster" {
  source                          = "../../../modules/gcp/gke/cluster-v2"
...
}


### Terraform Version

```sh
Terraform v0.14.11
+ provider registry.terraform.io/hashicorp/external v2.2.2
+ provider registry.terraform.io/hashicorp/google v4.25.0
+ provider registry.terraform.io/hashicorp/google-beta v4.25.0
+ provider registry.terraform.io/hashicorp/helm v2.6.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.12.1
+ provider registry.terraform.io/hashicorp/null v3.1.1
+ provider registry.terraform.io/hashicorp/random v3.3.2
+ provider registry.terraform.io/hashicorp/template v2.2.0

Additional information

No response

@DP19
Copy link
Contributor Author

DP19 commented Aug 22, 2022

@apeabody I know there's a release pr up that will have the changes in #1354 live; hoping to have this fix along with it 🤞🏻

@apeabody
Copy link
Contributor

Thanks @DP19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants