-
Notifications
You must be signed in to change notification settings - Fork 974
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
Allow config_path to be computed #142
Comments
I just experienced this in a similar scenario: I create a GKE cluster first, then I want to create a k8s resource within it (in this case s
As the |
for people stuck here, try not forcing dependencies between resources. Dependencies are implicit when using references to resources within variables and it's better like that. |
for other people stuck here: you can have this error message if you have |
@vpereira01 You can also set Here's a snippet of a setup I use which allows both terraform and kubectl to co-exist. provider "kubernetes" {
version = "~> 1.3"
load_config_file = false
host = "https://${data.google_container_cluster.test_cluster.endpoint}"
token = "${data.google_client_config.current.access_token}"
cluster_ca_certificate = "${base64decode(data.google_container_cluster.test_cluster.master_auth.0.cluster_ca_certificate)}"
} |
@pvormittag thanks for the pointer. Too bad AWS requires the use of a custom authenticator so I can't get around the generation of a kubeconfig file and hope it is not deleted (terraform doesn't seem to re-generate the local_file when the file is no longer there and there are no other changes. |
I hit the same issue on AWS EKS.
|
Same error here using aws eks module and kubernetes provider.
Does anyone here have a solution ? Right now it means I can't deploy automatically, I have to remove some files first, deploy once, and then add the kubernetes related files and then deploy a second time. Edit: found a potential workaround, not sure if it works |
What version of tf and the provider are folks seeing this issue with? I have deployments on GKE and EKS that create the cluster then use the |
This seems like the upstream progressive apply issue: hashicorp/terraform#4149 You cannot currently (reliably) chain together a provider's config with the output of a resource. |
I get this error with full apply, so don't think it's related to progressive apply issue. However I got this working by doing this:
|
I have a resource from a provider that creates a K8s cluster and another that downloads it's kube config. I can't seem to configure the provider with a
config_path
that will be computed at a later time ie. after the cluster is created.Terraform Version
v0.11.3
Affected Resource(s)
Terraform Configuration Files
I've simplified the example below but this is the flow:
Expected Behavior
Kubernetes provider should be instantiated and load
config_path
after thedata.container_cluster_config.test_cluster_config.config_file_path
is availableActual Behavior
Provider seems to be prematurely instantiating itself with no config.
Steps to Reproduce
The general flow above is the steps to reproduce. Basically try to instantiate the provider with a
config_path
that has yet to be generated ie. computed after the cluster resource is created.References
This is a slightly related issue: hashicorp/terraform#2430
The text was updated successfully, but these errors were encountered: