Skip to content

Commit c8cc60f

Browse files
bkmeneguellomax-rocket-internet
authored andcommitted
Add suspended_processes attributes to autoscaling_group (#153)
1 parent 6de0825 commit c8cc60f

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1212
- A useful addition (slam dunk, @self 🔥)
1313
- Worker groups can be created with a specified IAM profile. (from @laverya)
1414
- exposed `aws_eks_cluster` create and destroy timeouts (by @RGPosadas)
15+
- Added `suspended_processes` to `worker_groups` input (by @bkmeneguello)
1516
- exposed `placement_tenancy` for autoscaling group (by @monsterxx03)
1617
- Allow port 443 from EKS service to nodes to run `metrics-server`. (by @max-rocket-internet)
1718

local.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ locals {
3333
additional_security_group_ids = "" # A comman delimited list of additional security group ids to include in worker launch config
3434
protect_from_scale_in = false # Prevent AWS from scaling in, so that cluster-autoscaler is solely responsible.
3535
iam_role_id = "${local.default_iam_role_id}" # Use the specified IAM role if set.
36+
suspended_processes = "" # A comma delimited string of processes to to suspend. i.e. AZRebalance,HealthCheck,ReplaceUnhealthy
3637
}
3738

3839
workers_group_defaults = "${merge(local.workers_group_defaults_defaults, var.workers_group_defaults)}"

workers.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ resource "aws_autoscaling_group" "workers" {
66
launch_configuration = "${element(aws_launch_configuration.workers.*.id, count.index)}"
77
vpc_zone_identifier = ["${split(",", coalesce(lookup(var.worker_groups[count.index], "subnets", ""), local.workers_group_defaults["subnets"]))}"]
88
protect_from_scale_in = "${lookup(var.worker_groups[count.index], "protect_from_scale_in", local.workers_group_defaults["protect_from_scale_in"])}"
9+
suspended_processes = ["${split(",", coalesce(lookup(var.worker_groups[count.index], "suspended_processes", ""), local.workers_group_defaults["suspended_processes"]))}"]
910
count = "${var.worker_group_count}"
1011

1112
tags = ["${concat(
1213
list(
1314
map("key", "Name", "value", "${aws_eks_cluster.this.name}-${lookup(var.worker_groups[count.index], "name", count.index)}-eks_asg", "propagate_at_launch", true),
1415
map("key", "kubernetes.io/cluster/${aws_eks_cluster.this.name}", "value", "owned", "propagate_at_launch", true),
15-
map("key", "k8s.io/cluster-autoscaler/${lookup(var.worker_groups[count.index], "autoscaling_enabled", local.workers_group_defaults["autoscaling_enabled"]) == 1 ? "enabled" : "disabled" }", "value", "true", "propagate_at_launch", false),
16+
map("key", "k8s.io/cluster-autoscaler/${lookup(var.worker_groups[count.index], "autoscaling_enabled", local.workers_group_defaults["autoscaling_enabled"]) == 1 ? "enabled" : "disabled" }", "value", "true", "propagate_at_launch", false)
1617
),
1718
local.asg_tags)
1819
}"]

0 commit comments

Comments
 (0)