Skip to content

Commit 2310c13

Browse files
Fix Terraform formatting and add TLS 1.2 compliance for HTTPS listener with no certificate
Co-Authored-By: Loren Yu <loren@navapbc.com>
1 parent 3ae3128 commit 2310c13

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

infra/modules/service/load_balancer.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ resource "aws_lb_listener_rule" "http_to_https_redirect" {
8282

8383
resource "aws_lb_listener_rule" "app_http_forward" {
8484
count = var.certificate_arn == null ? 1 : 0
85-
85+
8686
listener_arn = aws_lb_listener.alb_listener_http.arn
8787
priority = 100
8888

@@ -124,7 +124,11 @@ resource "aws_lb_listener" "alb_listener_https_no_cert" {
124124

125125
load_balancer_arn = aws_lb.alb.arn
126126
port = 443
127-
protocol = "HTTP" # Using HTTP protocol for fixed-response
127+
protocol = "HTTPS"
128+
# Use a self-signed certificate for the 503 response
129+
certificate_arn = module.domain.certificate_arn
130+
# Use security policy that supports TLS 1.3 but requires at least TLS 1.2
131+
ssl_policy = "ELBSecurityPolicy-TLS13-1-2-2021-06"
128132

129133
default_action {
130134
type = "fixed-response"

0 commit comments

Comments
 (0)