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 load_balancers parameter to associate a CLB (Classic Load Balancer) to worker groups ASG #992

Merged
Show file tree
Hide file tree
Changes from all 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 @@ -70,6 +70,7 @@ locals {
iam_role_id = "local.default_iam_role_id" # A custom IAM role id. Incompatible with iam_instance_profile_name. Literal local.default_iam_role_id will never be used but if iam_role_id is not set, the local.default_iam_role_id interpolation will be used.
suspended_processes = ["AZRebalance"] # A list of processes to suspend. i.e. ["AZRebalance", "HealthCheck", "ReplaceUnhealthy"]
target_group_arns = null # A list of Application LoadBalancer (ALB) target group ARNs to be associated to the autoscaling group
load_balancers = null # A list of Classic LoadBalancer (CLB)'s name to be associated to the autoscaling group
enabled_metrics = [] # A list of metrics to be collected i.e. ["GroupMinSize", "GroupMaxSize", "GroupDesiredCapacity"]
placement_group = null # The name of the placement group into which to launch the instances, if any.
service_linked_role_arn = "" # Arn of custom service linked role that Auto Scaling group will use. Useful when you have encrypted EBS
Expand Down
5 changes: 5 additions & 0 deletions workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ resource "aws_autoscaling_group" "workers" {
"target_group_arns",
local.workers_group_defaults["target_group_arns"]
)
load_balancers = lookup(
var.worker_groups[count.index],
"load_balancers",
local.workers_group_defaults["load_balancers"]
)
service_linked_role_arn = lookup(
var.worker_groups[count.index],
"service_linked_role_arn",
Expand Down
5 changes: 5 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ resource "aws_autoscaling_group" "workers_launch_template" {
"target_group_arns",
local.workers_group_defaults["target_group_arns"]
)
load_balancers = lookup(
var.worker_groups_launch_template[count.index],
"load_balancers",
local.workers_group_defaults["load_balancers"]
)
service_linked_role_arn = lookup(
var.worker_groups_launch_template[count.index],
"service_linked_role_arn",
Expand Down