From 93614b329d1f2584b94e44f77328388663712093 Mon Sep 17 00:00:00 2001 From: Guillaume GILL Date: Mon, 5 Oct 2020 15:24:47 +0200 Subject: [PATCH] improvement: Make the `cpu_credits` optional for workers launch template (#1030) NOTES: `credit_specification` for worker groups launch template can now be set to `null` so that we can use non burstable EC2 families --- workers_launch_template.tf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/workers_launch_template.tf b/workers_launch_template.tf index 7e779b3..2546393 100644 --- a/workers_launch_template.tf +++ b/workers_launch_template.tf @@ -309,12 +309,15 @@ resource "aws_launch_template" "workers_launch_template" { ) } - credit_specification { - cpu_credits = lookup( + dynamic "credit_specification" { + for_each = lookup( var.worker_groups_launch_template[count.index], "cpu_credits", local.workers_group_defaults["cpu_credits"] - ) + ) != null ? [lookup(var.worker_groups_launch_template[count.index], "cpu_credits", local.workers_group_defaults["cpu_credits"])] : [] + content { + cpu_credits = credit_specification.value + } } monitoring {