Skip to content

Commit

Permalink
Fix service custom host headers
Browse files Browse the repository at this point in the history
* The condition was incorrectly returning true when domain names are
  empty
  • Loading branch information
Stretch96 committed Nov 25, 2024
1 parent a29fc8a commit 08f286a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ecs-cluster-infrastructure-service-alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ resource "aws_alb_listener_rule" "infrastructure_ecs_cluster_service_host_header

resource "aws_alb_listener_rule" "infrastructure_ecs_cluster_service_host_header_custom" {
for_each = {
for k, service in local.infrastructure_ecs_cluster_services : k => service if service["domain_names"] != null ? length(service["domain_names"]) > 0 : service["container_port"] != 0
for k, service in local.infrastructure_ecs_cluster_services : k => service if service["domain_names"] != null ? length(service["domain_names"]) > 0 && service["container_port"] != 0 : false
}

listener_arn = each.value["alb_tls_certificate_arn"] != null ? aws_alb_listener.infrastructure_ecs_cluster_service_https[0].arn : aws_alb_listener.infrastructure_ecs_cluster_service_http[0].arn
Expand Down

0 comments on commit 08f286a

Please sign in to comment.