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

Fix: Can't create zonal beta-private cluster is region not set. #806

Merged
merged 4 commits into from
Feb 12, 2021

Conversation

swbsf
Copy link
Contributor

@swbsf swbsf commented Feb 1, 2021

Hello,

Creating a zonal cluster will fail with a

Error: Invalid template interpolation value

  on .terraform/modules/gke_private/modules/beta-private-cluster/cluster.tf line 52, in resource "google_container_cluster" "primary":
  52:   subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}"
    |----------------
    | var.region is null

The expression result is null. Cannot include a null value in a string
template.

The bug seems here

subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}"

Which should reference local.region instead of var.region if I'm correct?

Creating a zonal cluster would fail with a 'var.region is null'
@swbsf swbsf requested review from bharathkkb, Jberlinsky and a team as code owners February 1, 2021 16:26
@comment-bot-dev
Copy link

comment-bot-dev commented Feb 1, 2021

Thanks for the PR! 🚀
✅ Lint checks have passed.

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes need to be made in autogen/.

modifying autogen too.
@swbsf
Copy link
Contributor Author

swbsf commented Feb 2, 2021

Changes need to be made in autogen/.

Ok done, anything else?

@morgante
Copy link
Contributor

morgante commented Feb 2, 2021

@swbsf You need to run make build.

@swbsf swbsf requested a review from morgante February 12, 2021 09:26
@morgante morgante merged commit f32dea7 into terraform-google-modules:master Feb 12, 2021
CPL-markus pushed a commit to WALTER-GROUP/terraform-google-kubernetes-engine that referenced this pull request Jul 15, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants