mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-05-02 21:34:38 +02:00
feat: Add Autoscaling schedule for EKS managed node group (#2504)
Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
This commit is contained in:
@@ -447,3 +447,25 @@ resource "aws_iam_role_policy_attachment" "additional" {
|
||||
policy_arn = each.value
|
||||
role = aws_iam_role.this[0].name
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Autoscaling Group Schedule
|
||||
################################################################################
|
||||
|
||||
resource "aws_autoscaling_schedule" "this" {
|
||||
for_each = { for k, v in var.schedules : k => v if var.create && var.create_schedule }
|
||||
|
||||
scheduled_action_name = each.key
|
||||
autoscaling_group_name = aws_eks_node_group.this[0].resources[0].autoscaling_groups[0].name
|
||||
|
||||
min_size = try(each.value.min_size, null)
|
||||
max_size = try(each.value.max_size, null)
|
||||
desired_capacity = try(each.value.desired_size, null)
|
||||
start_time = try(each.value.start_time, null)
|
||||
end_time = try(each.value.end_time, null)
|
||||
time_zone = try(each.value.time_zone, null)
|
||||
|
||||
# [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]
|
||||
# Cron examples: https://crontab.guru/examples.html
|
||||
recurrence = try(each.value.recurrence, null)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user