feat: Add support for ASG Warm Pools (#1310)

This commit is contained in:
Sergiu Plotnicu
2021-04-20 00:05:06 +03:00
committed by GitHub
parent fb5939314a
commit 2549408803
3 changed files with 21 additions and 0 deletions

View File

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

View File

@@ -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(
[

View File

@@ -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(
[