-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlb.tf
34 lines (28 loc) · 827 Bytes
/
lb.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
resource "aws_lb" "main" {
name = "SOAT-TC-ALB"
internal = true
load_balancer_type = "application"
ip_address_type = "ipv4"
security_groups = [aws_default_security_group.default.id]
subnets = aws_subnet.private_subnets[*].id
drop_invalid_header_fields = true
tags = {
Name : "SOAT Tech Challenge Internal Application Load Balancer"
}
}
resource "aws_lb_listener" "main" {
load_balancer_arn = aws_lb.main.arn
port = 80
protocol = "HTTP" #tfsec:ignore:aws-elb-http-not-used
default_action {
type = "fixed-response"
fixed_response {
content_type = "text/plain"
status_code = "418"
message_body = "SOAT Tech Challenge - ALB Invalid destination"
}
}
tags = {
Name : "SOAT-TC ALB HTTP Listener"
}
}