diff --git a/workers_launch_template.tf b/workers_launch_template.tf index 7e779b3b3a..2546393dc8 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 {