mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-23 15:01:19 +03:00
27 lines
578 B
Terraform
27 lines
578 B
Terraform
resource "aws_elb" "my-elb" {
|
|
name = "my-elb"
|
|
subnets = ["${aws_subnet.main-public-1.id}", "${aws_subnet.main-public-2.id}"]
|
|
security_groups = ["${aws_security_group.elb-securitygroup.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/"
|
|
interval = 30
|
|
}
|
|
|
|
cross_zone_load_balancing = true
|
|
connection_draining = true
|
|
connection_draining_timeout = 400
|
|
tags {
|
|
Name = "my-elb"
|
|
}
|
|
}
|
|
|