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

feat: Added custom AMI support for managed node groups (#1473)

This commit is contained in:
Andrii Barabash
2021-09-08 19:51:20 +03:00
committed by GitHub
parent 281e46a0e3
commit 1d322ebe3f
3 changed files with 9 additions and 3 deletions
+5 -3
View File
@@ -9,8 +9,10 @@ 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"]
kubelet_extra_args = each.value["kubelet_extra_args"]
cluster_name = var.cluster_name
run_bootstrap_script = lookup(each.value, "ami_id", null) != null
}
)
}
@@ -64,7 +66,7 @@ resource "aws_launch_template" "workers" {
}
# if you want to use a custom AMI
# image_id = var.ami_id
image_id = lookup(each.value, "ami_id", null)
# If you use a custom AMI, you need to supply via user-data, the bootstrap script as EKS DOESNT merge its managed user-data then
# you can add more than the minimum code you see in the template, e.g. install SSM agent, see https://github.com/aws/containers-roadmap/issues/593#issuecomment-577181345