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
To avoid the data lookup, should the example be modified to use the dependency inversion as described in the Terraform docs? For example, just have the main module pass a basic primary_cluster value between the submodules and remove the data "digitalocean_kubernetes_cluster" "primary" from the kubernetes-config submodule:
examples/kubernetes/doks-cluster/outputs.tf:
output "primary_cluster" {
value = {
id = digitalocean_kubernetes_cluster.primary.id
name = digitalocean_kubernetes_cluster.primary.name
endpoint = digitalocean_kubernetes_cluster.primary.endpoint
token = digitalocean_kubernetes_cluster.primary.kube_config[0].token
cluster_ca_certificate = digitalocean_kubernetes_cluster.primary.kube_config[0].cluster_ca_certificate
raw_config = digitalocean_kubernetes_cluster.primary.kube_config[0].raw_config
}
}
Originally posted by kriswuollett September 13, 2021
Is there a particular reason why cluster_name being tf-k8s-${random_id.cluster_name.hex} was needed in #564? When I remove the random_id resource and just set cluster_name to my_cluster, the output of terraform plan has the error:
│ Error: Unable to find cluster with name: my-cluster
│
│ with module.kubernetes-config.data.digitalocean_kubernetes_cluster.primary,
│ on kubernetes-config/main.tf line 18, in data "digitalocean_kubernetes_cluster" "primary":
│ 18: data "digitalocean_kubernetes_cluster" "primary" {
I'm new to Terraform so would like to learn more about this issue if it is not technically a bug. Thanks!
The text was updated successfully, but these errors were encountered:
To avoid the data lookup, should the example be modified to use the dependency inversion as described in the Terraform docs? For example, just have the main module pass a basic
primary_cluster
value between the submodules and remove thedata "digitalocean_kubernetes_cluster" "primary"
from thekubernetes-config
submodule:examples/kubernetes/doks-cluster/outputs.tf
:examples/kubernetes/kubernetes-config/variables.tf
:Discussed in #690
Originally posted by kriswuollett September 13, 2021
Is there a particular reason why
cluster_name
beingtf-k8s-${random_id.cluster_name.hex}
was needed in #564? When I remove therandom_id
resource and just setcluster_name
tomy_cluster
, the output ofterraform plan
has the error:I'm new to Terraform so would like to learn more about this issue if it is not technically a bug. Thanks!
The text was updated successfully, but these errors were encountered: