瀏覽代碼

Adds a redirect from http to https for the jira ALB

To be tagged v1.21.6
Fred Damstra 4 年之前
父節點
當前提交
e0281d5b38
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      base/jira/instance_jira/elb.tf

+ 16 - 0
base/jira/instance_jira/elb.tf

@@ -64,6 +64,22 @@ resource "aws_alb_listener" "jira_server_https_external" {
   }
 }
 
+resource "aws_lb_listener" "jira_server_listener_http" {
+  load_balancer_arn = aws_alb.jira_server_external.arn
+  port              = "80"
+  protocol          = "HTTP"
+
+  default_action {
+    type             = "redirect"
+
+    redirect {
+      port        = "443"
+      protocol    = "HTTPS"
+      status_code = "HTTP_301"
+    }
+  }
+}
+
 # #########################
 # # DNS Entry
 module "public_dns_record" {