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 support for ASG Warm Pools #1310

Merged
merged 3 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -71,6 +71,7 @@ locals {
termination_policies = [] # A list of policies to decide how the instances in the auto scale group should be terminated.
platform = "linux" # Platform of workers. either "linux" or "windows"
additional_ebs_volumes = [] # A list of additional volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), volume_size, volume_type, iops, encrypted, kms_key_id (only on launch-template), delete_on_termination. Optional values are grabbed from root volume or from defaults
warm_pool = null # If this block is configured, add a Warm Pool to the specified Auto Scaling group.
# Settings for launch templates
root_block_device_name = data.aws_ami.eks_worker.root_device_name # Root device name for workers. If non is provided, will assume default AMI was used.
root_kms_key_id = "" # The KMS key to use when encrypting the root storage device
Expand Down
10 changes: 10 additions & 0 deletions workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ resource "aws_autoscaling_group" "workers" {
}
}

dynamic "warm_pool" {
for_each = lookup(var.worker_groups[count.index], "warm_pool", null) != null ? [lookup(var.worker_groups[count.index], "warm_pool")] : []

content {
pool_state = lookup(warm_pool.value, "pool_state", null)
min_size = lookup(warm_pool.value, "min_size", null)
max_group_prepared_capacity = lookup(warm_pool.value, "max_group_prepared_capacity", null)
}
}

dynamic "tag" {
for_each = concat(
[
Expand Down
10 changes: 10 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ resource "aws_autoscaling_group" "workers_launch_template" {
}
}

dynamic "warm_pool" {
for_each = lookup(var.worker_groups_launch_template[count.index], "warm_pool", null) != null ? [lookup(var.worker_groups_launch_template[count.index], "warm_pool")] : []

content {
pool_state = lookup(warm_pool.value, "pool_state", null)
min_size = lookup(warm_pool.value, "min_size", null)
max_group_prepared_capacity = lookup(warm_pool.value, "max_group_prepared_capacity", null)
}
}

dynamic "tag" {
for_each = concat(
[
Expand Down