Skip to content

Commit

Permalink
Adding the ability to adjust the target deregistration behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Steiner <[email protected]>
  • Loading branch information
ntwrkguru committed Aug 19, 2024
1 parent bc0a641 commit 7404916
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/gwlb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ resource "aws_lb_target_group" "this" {
#
# tags = merge(var.global_tags, { Name = var.name }, var.lb_target_group_tags)
tags = var.lb_target_group_tags

target_failover {
on_deregistration = var.on_deregistration
on_unhealthy = var.on_unhealthy
Expand Down
12 changes: 10 additions & 2 deletions modules/gwlb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,21 @@ variable "unhealthy_threshold" {
variable "on_deregistration" {
description = "Indicates how the GWLB handles existing flows when a target is deregistered. Possible values are `rebalance` and `no_rebalance`. Must match the attribute value set for `on_unhealthy`. Default: `no_rebalance`"
default = "no_rebalance"
type = string
validation {
condition = var.on_unhealthy == var.on_deregistration
error_message = "Variable on_deregistration must be the same as variable on_unhealthy"
}
type = string
}

variable "on_unhealthy" {
description = "Indicates how the GWLB handles existing flows when a target is unhealthy. Possible values are `rebalance` and `no_rebalance`. Must match the attribute value set for `on_deregistration`. Default: `no_rebalance`"
default = "no_rebalance"
type = string
validation {
condition = var.on_deregistration == var.on_unhealthy
error_message = "Variable on_unhealthy must be the same as variable on_deregistration"
}
type = string
}

variable "stickiness_type" {
Expand Down

0 comments on commit 7404916

Please sign in to comment.