From 36b5b2af40a6d4de640246ec223e6eccd395df12 Mon Sep 17 00:00:00 2001 From: Guillaume GILL Date: Thu, 1 Oct 2020 16:40:28 +0200 Subject: [PATCH] CPU credits could be removed from launch template (permit launch of non burstable families) --- workers_launch_template.tf | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/workers_launch_template.tf b/workers_launch_template.tf index 600666a11d..0af41c43de 100644 --- a/workers_launch_template.tf +++ b/workers_launch_template.tf @@ -304,12 +304,19 @@ 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 ? [{}] : [] + content { + cpu_credits = lookup( + var.worker_groups_launch_template[count.index], + "cpu_credits", + local.workers_group_defaults["cpu_credits"] + ) + } } monitoring {