1
0
mirror of https://github.com/terraform-aws-modules/terraform-aws-eks.git synced 2025-09-09 19:32:58 +08:00

Fix cluster count

This commit is contained in:
syst0m
2019-10-31 17:49:36 +00:00
committed by Tomislav Tomasic
parent 75248e97df
commit 83eadaadf7
5 changed files with 42 additions and 42 deletions
+9 -9
View File
@@ -67,15 +67,15 @@ data "template_file" "kubeconfig" {
vars = {
kubeconfig_name = local.kubeconfig_name
endpoint = aws_eks_cluster.this.endpoint
cluster_auth_base64 = aws_eks_cluster.this.certificate_authority[0].data
endpoint = aws_eks_cluster.this[0].endpoint
cluster_auth_base64 = aws_eks_cluster.this[0].certificate_authority[0].data
aws_authenticator_command = var.kubeconfig_aws_authenticator_command
aws_authenticator_command_args = length(var.kubeconfig_aws_authenticator_command_args) > 0 ? " - ${join(
"\n - ",
var.kubeconfig_aws_authenticator_command_args,
)}" : " - ${join(
"\n - ",
formatlist("\"%s\"", ["token", "-i", aws_eks_cluster.this.name]),
formatlist("\"%s\"", ["token", "-i", aws_eks_cluster.this[0].name]),
)}"
aws_authenticator_additional_args = length(var.kubeconfig_aws_authenticator_additional_args) > 0 ? " - ${join(
"\n - ",
@@ -117,9 +117,9 @@ data "template_file" "userdata" {
vars = merge({
platform = lookup(var.worker_groups[count.index], "platform", local.workers_group_defaults["platform"])
cluster_name = aws_eks_cluster.this.name
endpoint = aws_eks_cluster.this.endpoint
cluster_auth_base64 = aws_eks_cluster.this.certificate_authority[0].data
cluster_name = aws_eks_cluster.this[count.index].name
endpoint = aws_eks_cluster.this[count.index].endpoint
cluster_auth_base64 = aws_eks_cluster.this[count.index].certificate_authority[0].data
pre_userdata = lookup(
var.worker_groups[count.index],
"pre_userdata",
@@ -163,9 +163,9 @@ data "template_file" "launch_template_userdata" {
vars = merge({
platform = lookup(var.worker_groups_launch_template[count.index], "platform", local.workers_group_defaults["platform"])
cluster_name = aws_eks_cluster.this.name
endpoint = aws_eks_cluster.this.endpoint
cluster_auth_base64 = aws_eks_cluster.this.certificate_authority[0].data
cluster_name = aws_eks_cluster.this[count.index].name
endpoint = aws_eks_cluster.this[count.index].endpoint
cluster_auth_base64 = aws_eks_cluster.this[count.index].certificate_authority[0].data
pre_userdata = lookup(
var.worker_groups_launch_template[count.index],
"pre_userdata",