Skip to content
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
29 changes: 14 additions & 15 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ resource "aws_lb_listener" "this" {
certificate_arn = try(each.value.certificate_arn, null)

dynamic "default_action" {
for_each = try([each.value.authenticate_cognito], [])
for_each = can(coalesce(each.value.authenticate_cognito)) ? [each.value.authenticate_cognito] : []

content {
authenticate_cognito {
Expand All @@ -112,7 +112,7 @@ resource "aws_lb_listener" "this" {
}

dynamic "default_action" {
for_each = try([each.value.authenticate_oidc], [])
for_each = can(coalesce(each.value.authentication_oidc)) ? [each.value.authenticate_oidc] : []

content {
authenticate_oidc {
Expand All @@ -135,7 +135,7 @@ resource "aws_lb_listener" "this" {
}

dynamic "default_action" {
for_each = try([each.value.fixed_response], [])
for_each = can(coalesce(each.value.fixed_response)) ? [each.value.fixed_response] : []

content {
fixed_response {
Expand All @@ -150,7 +150,7 @@ resource "aws_lb_listener" "this" {
}

dynamic "default_action" {
for_each = try([each.value.forward], [])
for_each = can(coalesce(each.value.forward)) ? [each.value.forward] : []

content {
order = try(default_action.value.order, null)
Expand All @@ -160,7 +160,7 @@ resource "aws_lb_listener" "this" {
}

dynamic "default_action" {
for_each = try([each.value.weighted_forward], [])
for_each = can(coalesce(each.value.weighted_forward)) ? [each.value.weighted_forward] : []

content {
forward {
Expand Down Expand Up @@ -189,7 +189,7 @@ resource "aws_lb_listener" "this" {
}

dynamic "default_action" {
for_each = try([each.value.redirect], [])
for_each = can(coalesce(each.value.redirect)) ? [each.value.redirect] : []

content {
order = try(default_action.value.order, null)
Expand All @@ -208,7 +208,7 @@ resource "aws_lb_listener" "this" {
}

dynamic "mutual_authentication" {
for_each = try([each.value.mutual_authentication], [])
for_each = can(coalesce(each.value.mutual_authentication)) ? [each.value.mutual_authentication] : []
content {
mode = mutual_authentication.value.mode
trust_store_arn = try(mutual_authentication.value.trust_store_arn, null)
Expand Down Expand Up @@ -493,7 +493,7 @@ resource "aws_lb_target_group" "this" {
deregistration_delay = try(each.value.deregistration_delay, null)

dynamic "health_check" {
for_each = try([each.value.health_check], [])
for_each = can(coalesce(each.value.health_check)) ? [each.value.health_check] : []

content {
enabled = try(health_check.value.enabled, null)
Expand Down Expand Up @@ -523,7 +523,7 @@ resource "aws_lb_target_group" "this" {
slow_start = try(each.value.slow_start, null)

dynamic "stickiness" {
for_each = try([each.value.stickiness], [])
for_each = can(coalesce(each.value.stickiness)) ? [each.value.stickiness] : []

content {
cookie_duration = try(stickiness.value.cookie_duration, null)
Expand All @@ -534,7 +534,7 @@ resource "aws_lb_target_group" "this" {
}

dynamic "target_failover" {
for_each = try(each.value.target_failover, [])
for_each = can(coalesce(each.value.target_failover)) ? each.value.target_failover : []

content {
on_deregistration = target_failover.value.on_deregistration
Expand All @@ -543,12 +543,11 @@ resource "aws_lb_target_group" "this" {
}

dynamic "target_group_health" {
for_each = try([each.value.target_group_health], [])
for_each = can(coalesce(each.value.target_group_health)) ? [each.value.target_group_health] : []

content {

dynamic "dns_failover" {
for_each = try([target_group_health.value.dns_failover], [])
for_each = can(coalesce(target_group_health.value.dns_failover)) ? [target_group_health.value.dns_failover] : []

content {
minimum_healthy_targets_count = try(dns_failover.value.minimum_healthy_targets_count, null)
Expand All @@ -557,7 +556,7 @@ resource "aws_lb_target_group" "this" {
}

dynamic "unhealthy_state_routing" {
for_each = try([target_group_health.value.unhealthy_state_routing], [])
for_each = can(coalesce(target_group_health.value.unhealthy_state_routing)) ? [target_group_health.value.unhealthy_state_routing] : []

content {
minimum_healthy_targets_count = try(unhealthy_state_routing.value.minimum_healthy_targets_count, null)
Expand All @@ -568,7 +567,7 @@ resource "aws_lb_target_group" "this" {
}

dynamic "target_health_state" {
for_each = try([each.value.target_health_state], [])
for_each = can(coalesce(each.value.target_health_state)) ? [each.value.target_health_state] : []
content {
enable_unhealthy_connection_termination = try(target_health_state.value.enable_unhealthy_connection_termination, true)
unhealthy_draining_interval = try(target_health_state.value.unhealthy_draining_interval, null)
Expand Down
Loading