-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
No self link, apply is failing #100
Comments
Oh! This is an issue present in |
Hi! I have same issue too, but i have the new provider version:
|
I was able to get around this by using the default network for everything. module "gke" {
source = "terraform-google-modules/kubernetes-engine/google"
project_id = "${var.project}"
name = "${var.cluster_name}"
region = "${var.region}"
zones = "${var.zones}"
network = "default"
subnetwork = "default"
ip_range_pods = "default"
ip_range_services = "default"
} I guess this means that I would have to manually create these networks/subnets to use different names? Either these networks should be automatically generated or the documentation needs updating |
@rileykarson Can you confirm if this has been fixed in the provider? |
It should have been fixed in |
@vdt-mik Any chance you could share your config? |
@jonnymcgow7 can you please confirm if using version 2.2.0 or greater of the provider fixes this issue? |
https://github.com/SubhakarKotta/gcloud-gke-rds-terraform/tree/master/frameworks provider "google" {
version = "~> 2.3.0"
credentials = "${ file(var.credentials) }"
project = "${var.project_id}"
region = "${var.region}"
}
provider "google-beta" {
version = "~> 2.3.0"
credentials = "${ file(var.credentials) }"
project = "${var.project_id}"
region = "${var.region}"
} |
@subhakarkotta can you please file as issue against https://github.com/terraform-providers/terraform-provider-google? |
Issue filed hashicorp/terraform-provider-google#3746 |
I am hitting this as well, and I am referencing the networking name in the gke module. My providers provider "google" {
version = "2.7.0"
project = "${var.project_id}"
region = "${var.region}"
}
provider "google-beta" {
version = "2.7.0"
project = "${var.project_id}"
region = "${var.region}"
} snippet from my cluster module "gke" {
source = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
enable_private_endpoint = "true"
enable_private_nodes = "true"
// TODO make this configurable
master_ipv4_cidr_block = "10.0.0.0/28"
project_id = "${var.project_id}"
name = "${var.cluster_name}"
region = "${var.region}"
zones = "${var.zones}" // FIXME we may need to convert a list to a string here
regional = true
kubernetes_version = "1.13.5-gke.10"
network = "${module.gke-network.network_name}"
subnetwork = "my-subnet" // TODO use a variable??
} |
I even added output "name" {
description = "Cluster name"
value = "${module.gke.name}"
depends_on = [ "${module.gke-network.network_name}" ]
} And that did not help |
@chrislovecnm could you try using an element of |
It is an array, not a singular name, let me workout the syntax 😅 |
|
Wahoo! Yes adding the subnet as a var helped. |
@chrislovecnm Excellent! |
@aaron-lane Thanks It worked |
Hi Aaron, Terraform v0.11.14
I'm stuck on the same error when applying plan. I tried "${element(module.gke-network.subnets_names, 0)}", but no module by that name. |
@MichelBoucey How are you creating your network? For that to work, you need If you can share your Terraform config, we'll be able to help easier. |
I knew this module wasn't used so far but it seems the only trick to trigger the discover or creation of the resource Well, I'm just following the simple_regional_private example:
|
@MichelBoucey What exactly is the error you get? It expects subnetwork name as an input. |
I get, exactly as @jonnymcgow7, module.gke.google_container_cluster.primary: Resource 'data.google_compute_subnetwork.gke_subnetwork' not found for variable 'data.google_compute_subnetwork.gke_subnetwork.self_link' |
@MichelBoucey Where is |
@morgante I thought it was just a name to provide, not to point at an already created resource by its name, but to create the subnetwork by that name. So, |
Ah, this module doesn't take care of creating the subnetwork. You need to provide a subnetwork from outside the module, which you can use the network module to handle. |
@morgante Oh thank you very much. It's clearer now. I thought |
@morgante we should have an example that builds a network and a cluster as well. I have some TF that I can contribute, once I get the beta module stuff sorted |
@chrislovecnm My thoughts exactly. :) I opened #195 to track. |
Tried the suggestion here: #100 (comment)
I don't really have the need for a shared network, but setting default in this way isn't working for me. Must I create a network despite the fact that the |
@DXCanas I'm a little unclear on your ask. Most users of this module are using it with a custom network rather than the default VPC network. If you want to use the default VPC, you should be able to though—you just have to specify it. Is that not working for you? |
@morgante That's exactly right! I get:
With this config:
|
Got it, opened #211 to track. |
We're following almost exactly the readme spec and terraform plan works fine, but when we run apply we get this error:
* module.gke.google_container_cluster.primary: Resource 'data.google_compute_subnetwork.gke_subnetwork' not found for variable 'data.google_compute_subnetwork.gke_subnetwork.self_link'
Is this a versioning problem on our end maybe? We've tried going through the other issues and the readme but have struggled to find the source of our problem. for the provider we have:
And in main.tf we define the module with that specified provider:
Any help is much appreciated, thanks.
The text was updated successfully, but these errors were encountered: