Skip to content

Commit 93614b3

Browse files
authored
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
1 parent 8c8f4b5 commit 93614b3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

workers_launch_template.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,15 @@ resource "aws_launch_template" "workers_launch_template" {
309309
)
310310
}
311311

312-
credit_specification {
313-
cpu_credits = lookup(
312+
dynamic "credit_specification" {
313+
for_each = lookup(
314314
var.worker_groups_launch_template[count.index],
315315
"cpu_credits",
316316
local.workers_group_defaults["cpu_credits"]
317-
)
317+
) != null ? [lookup(var.worker_groups_launch_template[count.index], "cpu_credits", local.workers_group_defaults["cpu_credits"])] : []
318+
content {
319+
cpu_credits = credit_specification.value
320+
}
318321
}
319322

320323
monitoring {

0 commit comments

Comments
 (0)