-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Added output for generated kubeconfig filename #272
Conversation
@syst0m hello! |
@okgolove I cannot reproduce your error. |
I meant, I don't have kubectl config path output from EKS module (but you've added it within this PR) and my Helm provider isn't able to wait EKS module creates kubeconfig file. By default (without kubeconfig) Helm provider tries to access tiller via localhost. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
@okgolove i believe, unless things have changed in the last year, that what you are referring to is a general problem with Terraform itself in that the output of resources from one provider cannot be used as input to another provider. Where this change helps, at least for me, when you want to reference the output of Terraform state as the input to a different set of Terraform configuration. |
outputs.tf
Outdated
@@ -39,6 +39,11 @@ output "kubeconfig" { | |||
value = "${data.template_file.kubeconfig.rendered}" | |||
} | |||
|
|||
output "kubeconfig_filename" { | |||
description = "The filename of the generated kubectl config." | |||
value = "${local_file.kubeconfig.*.filename}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If kubeconfig
is disabled (var.write_kubeconfig = 0
) this value won't work. Change this to:
value = ${element(concat(local_file.kubeconfig.*.filename, list("")), 0)}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, @antonbabenko .
I updated the PR.
v2.2.1 has been released. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
PR o'clock
Description
The terraform helm provider uses a kubectl config filename as a config parameter.
The eks module generates a kubectl config with a random filename.
In order to enable integration between the two and facilitate automated provisioning of an eks cluster,
by passing the kubectl config filename as an input
to the terraform helm provider, I added a new output to the eks module.
terraform helm provider: https://github.com/terraform-providers/terraform-provider-helm
Checklist
terraform fmt
andterraform validate
both work from the root andexamples/eks_test_fixture
directories (look in CI for an example)