mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-25 02:41:03 +01:00
allow user to overwrite the kubeconfig default args (#129)
* allow user to overwrite the kubeconfig default args * quote args to auth command
This commit is contained in:
committed by
Max Williams
parent
31ec0f7db3
commit
e1e265bf21
4
data.tf
4
data.tf
@@ -44,13 +44,13 @@ data "template_file" "kubeconfig" {
|
||||
template = "${file("${path.module}/templates/kubeconfig.tpl")}"
|
||||
|
||||
vars {
|
||||
cluster_name = "${aws_eks_cluster.this.name}"
|
||||
kubeconfig_name = "${local.kubeconfig_name}"
|
||||
endpoint = "${aws_eks_cluster.this.endpoint}"
|
||||
region = "${data.aws_region.current.name}"
|
||||
cluster_auth_base64 = "${aws_eks_cluster.this.certificate_authority.0.data}"
|
||||
aws_authenticator_command = "${var.kubeconfig_aws_authenticator_command}"
|
||||
aws_authenticator_additional_args = "${length(var.kubeconfig_aws_authenticator_additional_args) > 0 ? " - ${join("\n - ", var.kubeconfig_aws_authenticator_additional_args)}" : "" }"
|
||||
aws_authenticator_command_args = "${length(var.kubeconfig_aws_authenticator_command_args) > 0 ? " - ${join("\n - ", var.kubeconfig_aws_authenticator_command_args)}" : " - ${join("\n - ", formatlist("\"%s\"", list("token", "-i", aws_eks_cluster.this.name)))}"}"
|
||||
aws_authenticator_additional_args = "${length(var.kubeconfig_aws_authenticator_additional_args) > 0 ? " - ${join("\n - ", var.kubeconfig_aws_authenticator_additional_args)}" : ""}"
|
||||
aws_authenticator_env_variables = "${length(var.kubeconfig_aws_authenticator_env_variables) > 0 ? " env:\n${join("\n", data.template_file.aws_authenticator_env_variables.*.rendered)}" : ""}"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user