Skip to content

Commit

Permalink
feat: Add load_balancers parameter to associate a CLB (Classic Load…
Browse files Browse the repository at this point in the history
… Balancer) to worker groups ASG (#992)
  • Loading branch information
hacker65536 authored Oct 5, 2020
1 parent d8ab5d4 commit 8c8f4b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
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

0 comments on commit 8c8f4b5

Please sign in to comment.