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

feat: Fix custom AMI bootstrap (#1580)

This commit is contained in:
Steve Hipwell
2021-10-08 15:41:10 +01:00
committed by GitHub
parent b177806614
commit f198efd2c4
4 changed files with 32 additions and 9 deletions
+7 -2
View File
@@ -9,10 +9,15 @@ data "cloudinit_config" "workers_userdata" {
content_type = "text/x-shellscript"
content = templatefile("${path.module}/templates/userdata.sh.tpl",
{
pre_userdata = each.value["pre_userdata"]
kubelet_extra_args = each.value["kubelet_extra_args"]
pre_userdata = each.value["pre_userdata"]
ami_id = lookup(each.value, "ami_id", "")
ami_is_eks_optimized = each.value["ami_is_eks_optimized"]
cluster_name = var.cluster_name
run_bootstrap_script = lookup(each.value, "ami_id", null) != null
cluster_endpoint = data.aws_eks_cluster.default.endpoint
cluster_ca = data.aws_eks_cluster.default.certificate_authority[0].data
capacity_type = lookup(each.value, "capacity_type", "ON_DEMAND")
append_labels = length(lookup(each.value, "k8s_labels", {})) > 0 ? ",${join(",", [for k, v in lookup(each.value, "k8s_labels", {}) : "${k}=${v}"])}" : ""
}
)
}