feat: Add Launch Template support for Managed Node Groups (#997)

NOTES: Managed Node Groups now support Launch Templates. The Launch Template it self is not managed by this module, so you have to create it by your self and pass it's id to this module. See docs and [`examples/launch_templates_with_managed_node_groups/`](https://github.com/terraform-aws-modules/terraform-aws-eks/tree/master/examples/launch_templates_with_managed_node_group) for more details.
This commit is contained in:
philicious
2020-11-02 08:19:10 +01:00
committed by GitHub
parent 62a8f46ba7
commit 127a3a8831
12 changed files with 314 additions and 11 deletions

View File

@@ -15,7 +15,7 @@ resource "aws_eks_node_group" "workers" {
ami_type = lookup(each.value, "ami_type", null)
disk_size = lookup(each.value, "disk_size", null)
instance_types = [each.value["instance_type"]]
instance_types = each.value["launch_template_id"] != "" ? [] : [each.value["instance_type"]]
release_version = lookup(each.value, "ami_release_version", null)
dynamic "remote_access" {
@@ -30,6 +30,18 @@ resource "aws_eks_node_group" "workers" {
}
}
dynamic "launch_template" {
for_each = each.value["launch_template_id"] != "" ? [{
id = each.value["launch_template_id"]
version = each.value["launch_template_version"]
}] : []
content {
id = launch_template.value["id"]
version = launch_template.value["version"]
}
}
version = lookup(each.value, "version", null)
labels = merge(