forked from chinnareddaiah/terraform-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelb.tf
35 lines (31 loc) · 898 Bytes
/
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
# Create a new load balancer
resource "aws_elb" "javahome-elb" {
name = "javahome-elb"
# availability_zones = ["${var.azs}"]
subnets = ["${aws_subnet.public.*.id}"]
security_groups = ["${aws_security_group.webservers.id}"]
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/index.html"
interval = 10
}
instances = ["${aws_instance.webservers.*.id}"]
cross_zone_load_balancing = true
idle_timeout = 100
connection_draining = true
connection_draining_timeout = 300
tags {
Name = "javahome-terraform-elb"
}
}
output "elb-dns-name"{
value = "${aws_elb.javahome-elb.dns_name}"
}