Files
terraform-aws-eks/modules/node_groups/random.tf
Jonathan Cole 8978997bb1 feat: Add the SPOT support for Managed Node Groups (#1129)
BREAKING CHANGES: To add add SPOT support for MNG, the `instance_type` is now a list and renamed as `instance_types`. This will probably rebuild existing Managed Node Groups.
2021-01-28 23:08:29 +01:00

28 lines
830 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)
capacity_type = lookup(each.value, "capacity_type", null)
iam_role_arn = each.value["iam_role_arn"]
instance_types = join("|", compact(
lookup(each.value, "instance_types", [])
))
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]
}