mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-11 21:11:32 +01:00
feat: Add support for ASG Warm Pools (#1310)
This commit is contained in:
1
local.tf
1
local.tf
@@ -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
|
||||
|
||||
10
workers.tf
10
workers.tf
@@ -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(
|
||||
[
|
||||
|
||||
@@ -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(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user