mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-04-21 16:21:19 +02:00
feat: Add load_balancers parameter to associate a CLB (Classic Load Balancer) to worker groups ASG (#992)
This commit is contained in:
1
local.tf
1
local.tf
@@ -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.
|
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"]
|
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
|
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"]
|
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.
|
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
|
service_linked_role_arn = "" # Arn of custom service linked role that Auto Scaling group will use. Useful when you have encrypted EBS
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ resource "aws_autoscaling_group" "workers" {
|
|||||||
"target_group_arns",
|
"target_group_arns",
|
||||||
local.workers_group_defaults["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(
|
service_linked_role_arn = lookup(
|
||||||
var.worker_groups[count.index],
|
var.worker_groups[count.index],
|
||||||
"service_linked_role_arn",
|
"service_linked_role_arn",
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ resource "aws_autoscaling_group" "workers_launch_template" {
|
|||||||
"target_group_arns",
|
"target_group_arns",
|
||||||
local.workers_group_defaults["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(
|
service_linked_role_arn = lookup(
|
||||||
var.worker_groups_launch_template[count.index],
|
var.worker_groups_launch_template[count.index],
|
||||||
"service_linked_role_arn",
|
"service_linked_role_arn",
|
||||||
|
|||||||
Reference in New Issue
Block a user