-
Notifications
You must be signed in to change notification settings - Fork 0
/
elbv2_httpbin.tf
42 lines (35 loc) · 920 Bytes
/
elbv2_httpbin.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
35
36
37
38
39
40
41
42
resource "aws_lb" "httpbin" {
name = "httpbin-alb"
load_balancer_type = "application"
subnets = [
module.vpc.subnet_public1,
module.vpc.subnet_public2,
module.vpc.subnet_public3,
]
security_groups = [
module.vpc.sg_allow_egress,
module.vpc.sg_allow_80,
]
}
resource "aws_lb_listener" "httpbin" {
default_action {
target_group_arn = aws_lb_target_group.httpbin.arn
type = "forward"
}
load_balancer_arn = aws_lb.httpbin.arn
port = 80
}
resource "aws_lb_target_group" "httpbin" {
name = "httpbin-fargate-firehose"
vpc_id = module.vpc.vpc_id
port = 8080
protocol = "HTTP"
deregistration_delay = 5
target_type = "ip"
health_check {
healthy_threshold = 2
unhealthy_threshold = 10
interval = 5
timeout = 2
}
}