Skip to content

Commit

Permalink
feat: added a stickiness feature for alb aws_alb_target_group
Browse files Browse the repository at this point in the history
  • Loading branch information
jp08-it committed Nov 14, 2023
1 parent 4f8ea6c commit 9449b46
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ resource "aws_alb_target_group" "main" {
}
}

dynamic "stickiness" {
for_each = length(keys(lookup(var.target_groups[count.index], "stickiness", {}))) == 0 ? [] : [
lookup(var.target_groups[count.index], "stickiness", {})]

content {
cookie_duration = lookup(stickiness.value, "cookie_duration", null)
cookie_name = lookup(stickiness.value, "cookie_name", null)
enabled = lookup(stickiness.value, "enabled", null)
type = lookup(stickiness.value, "type", null)
}
}

lifecycle {
create_before_destroy = true
}
Expand Down

0 comments on commit 9449b46

Please sign in to comment.