diff --git a/main.tf b/main.tf index e620383..d9825df 100644 --- a/main.tf +++ b/main.tf @@ -81,5 +81,15 @@ resource "aws_alb_target_group" "default_target_group" { service = "${var.env}-${local.default_target_group_component}" team = var.team } + + dynamic "stickiness" { + for_each = var.sticky + content { + cookie_duration = stickiness.value["cookie_duration"] + cookie_name = stickiness.value["cookie_name"] + enabled = stickiness.value["enabled"] + type = stickiness.value["type"] + } + } } diff --git a/variables.tf b/variables.tf index f181f12..00b9a09 100644 --- a/variables.tf +++ b/variables.tf @@ -255,3 +255,8 @@ variable "run_data" { default = true } + +variable "sticky" { + description = "turn on sticky" + default = [] +}