-
Notifications
You must be signed in to change notification settings - Fork 2
/
elb.tf
37 lines (32 loc) · 1.01 KB
/
elb.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
# Create a new load balancer
resource "aws_elb" "prod-elb" {
name = "prod-elb"
#availability_zones = ["us-east-1a", "us-east-1b", "us-east-1c"]
# access_logs {
# bucket = "glauciushabucketnewhorizon2020"
# bucket_prefix = "elb"
# interval = 60
# }
listener {
instance_port = 80
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}
health_check {
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 3
target = "HTTP:80/check.html"
interval = 30
}
instances = [aws_instance.WEB01.id,aws_instance.WEB02.id,aws_instance.WEB03.id]
subnets = [aws_subnet.prod-subnet-public-1.id,aws_subnet.prod-subnet-public-2.id,aws_subnet.prod-subnet-public-3.id]
cross_zone_load_balancing = true
idle_timeout = 400
connection_draining = true
connection_draining_timeout = 400
tags = {
Name = "prod-elb"
}
}