Skip to content

Commit

Permalink
improvement: Make the cpu_credits optional for workers launch templ…
Browse files Browse the repository at this point in the history
…ate (#1030)

NOTES: `credit_specification` for worker groups launch template can now be set to `null` so that we can use non burstable EC2 families
  • Loading branch information
gillg authored Oct 5, 2020
1 parent 8c8f4b5 commit 93614b3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 93614b3

Please sign in to comment.