Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added a stickiness feature for alb aws_alb_target_group #124

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

vpc_id = var.vpc_id
port = lookup(var.target_groups[count.index], "backend_port", null)
protocol = lookup(var.target_groups[count.index], "backend_protocol", null) != null ? upper(lookup(var.target_groups[count.index], "backend_protocol")) : null

Check warning on line 13 in alb.tf

View workflow job for this annotation

GitHub Actions / validate (~1.3.0)

Lookup with 2 arguments is deprecated
protocol_version = lookup(var.target_groups[count.index], "protocol_version", null) != null ? upper(lookup(var.target_groups[count.index], "protocol_version")) : null

Check warning on line 14 in alb.tf

View workflow job for this annotation

GitHub Actions / validate (~1.3.0)

Lookup with 2 arguments is deprecated
target_type = lookup(var.target_groups[count.index], "target_type", null)

deregistration_delay = lookup(var.target_groups[count.index], "deregistration_delay", null)
Expand All @@ -38,6 +38,18 @@
}
}

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", true)
type = lookup(stickiness.value, "type", null)
jp08-it marked this conversation as resolved.
Show resolved Hide resolved
}
}

lifecycle {
create_before_destroy = true
}
Expand Down
Loading