Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add capacity_rebalance support for self-managed worker groups #1326

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ locals {
instance_refresh_min_healthy_percentage = 90 # The amount of capacity in the ASG that must remain healthy during an instance refresh, as a percentage of the ASG's desired capacity.
instance_refresh_instance_warmup = null # The number of seconds until a newly launched instance is configured and ready to use. Defaults to the ASG's health check grace period.
instance_refresh_triggers = [] # Set of additional property names that will trigger an Instance Refresh. A refresh will always be triggered by a change in any of launch_configuration, launch_template, or mixed_instances_policy.
capacity_rebalance = false # Enable capacity rebalance
}

workers_group_defaults = merge(
Expand Down
5 changes: 5 additions & 0 deletions workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ resource "aws_autoscaling_group" "workers" {
"health_check_grace_period",
local.workers_group_defaults["health_check_grace_period"]
)
capacity_rebalance = lookup(
var.worker_groups[count.index],
"capacity_rebalance",
local.workers_group_defaults["capacity_rebalance"]
)

dynamic "initial_lifecycle_hook" {
for_each = var.worker_create_initial_lifecycle_hooks ? lookup(var.worker_groups[count.index], "asg_initial_lifecycle_hooks", local.workers_group_defaults["asg_initial_lifecycle_hooks"]) : []
Expand Down
5 changes: 5 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ resource "aws_autoscaling_group" "workers_launch_template" {
"health_check_grace_period",
local.workers_group_defaults["health_check_grace_period"]
)
capacity_rebalance = lookup(
LAKostis marked this conversation as resolved.
Show resolved Hide resolved
var.worker_groups_launch_template[count.index],
"capacity_rebalance",
local.workers_group_defaults["capacity_rebalance"]
)

dynamic "mixed_instances_policy" {
iterator = item
Expand Down