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
This commit is contained in:
Guillaume GILL
2020-10-05 15:24:47 +02:00
committed by GitHub
parent 8c8f4b56eb
commit 93614b329d

View File

@@ -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 {