Skip to content

Commit 6853afd

Browse files
committed
Fix SSL policy issue
1 parent 9552058 commit 6853afd

File tree

1 file changed

+14
-2
lines changed
  • operations/deployment/terraform/modules/aws/lb

1 file changed

+14
-2
lines changed

operations/deployment/terraform/modules/aws/lb/aws_lb.tf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,20 @@ resource "aws_lb_listener" "vm_alb_listener" {
9292
target_group_arn = aws_lb_target_group.vm_alb_tg[count.index].arn
9393
}
9494
# https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html
95-
ssl_policy = local.alb_listen_protocol[count.index] == "HTTPS" ? var.aws_alb_ssl_policy : null
96-
certificate_arn = local.alb_listen_protocol[count.index] == "HTTPS" ? var.aws_certificates_selected_arn : null
95+
96+
dynamic "ssl_policy" {
97+
for_each = local.alb_listen_protocol[count.index] == "HTTPS" ? [1] : []
98+
content {
99+
ssl_policy = var.aws_alb_ssl_policy
100+
}
101+
}
102+
103+
dynamic "certificate_arn" {
104+
for_each = local.alb_listen_protocol[count.index] == "HTTPS" ? [1] : []
105+
content {
106+
certificate_arn = var.aws_certificates_selected_arn
107+
}
108+
}
97109
}
98110

99111
# Attach EC2 instance(s) to target group(s)

0 commit comments

Comments
 (0)