File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
operations/deployment/terraform/modules/aws/ecs Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ resource "aws_alb_listener" "http_www_redirect" {
228228}
229229
230230resource "aws_lb_listener_rule" "http_forward_apex" {
231- count = var. aws_ecs_lb_www_to_apex_redirect && var. aws_r53_domain_name != " " && ! var. aws_certificate_enabled ? 1 : 0
231+ count = var. aws_ecs_lb_www_to_apex_redirect && var. aws_r53_domain_name != " " && ! var. aws_certificate_enabled && length (aws_alb_listener . http_www_redirect ) > 0 ? 1 : 0
232232 listener_arn = aws_alb_listener. http_www_redirect [0 ]. arn
233233 priority = 20
234234
@@ -245,7 +245,7 @@ resource "aws_lb_listener_rule" "http_forward_apex" {
245245}
246246
247247resource "aws_lb_listener_rule" "redirect_www_to_apex" {
248- count = var. aws_ecs_lb_www_to_apex_redirect && var. aws_r53_domain_name != " " ? 1 : 0
248+ count = var. aws_ecs_lb_www_to_apex_redirect && var. aws_r53_domain_name != " " && (var . aws_certificate_enabled ? length (aws_alb_listener . https_redirect ) > 0 : length (aws_alb_listener . http_www_redirect ) > 0 ) ? 1 : 0
249249 listener_arn = var. aws_certificate_enabled ? aws_alb_listener. https_redirect [0 ]. arn : aws_alb_listener. http_www_redirect [0 ]. arn
250250 priority = 10
251251
You can’t perform that action at this time.
0 commit comments