Files
terraform-aws-eks/modules/node_groups/random.tf
philicious 127a3a8831 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.
2020-11-02 08:19:10 +01:00

25 lines
722 B
HCL

resource "random_pet" "node_groups" {
for_each = local.node_groups_expanded
separator = "-"
length = 2
keepers = {
ami_type = lookup(each.value, "ami_type", null)
disk_size = lookup(each.value, "disk_size", null)
instance_type = each.value["instance_type"]
iam_role_arn = each.value["iam_role_arn"]
key_name = each.value["key_name"]
source_security_group_ids = join("|", compact(
lookup(each.value, "source_security_group_ids", [])
))
subnet_ids = join("|", each.value["subnets"])
node_group_name = join("-", [var.cluster_name, each.key])
launch_template = lookup(each.value, "launch_template_id", null)
}
depends_on = [var.ng_depends_on]
}