Skip to content

Instantly share code, notes, and snippets.

@Moiz-Ali-Moomin
Created June 14, 2021 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Moiz-Ali-Moomin/bc2bbf44887d95f3d3b152bb9c331dc1 to your computer and use it in GitHub Desktop.
Save Moiz-Ali-Moomin/bc2bbf44887d95f3d3b152bb9c331dc1 to your computer and use it in GitHub Desktop.
# Create a new load balancer
resource "aws_elb" "terra-elb" {
name = "terra-elb"
#availability_zones = ["${var.azs}"]
subnets = "${var.subnet_id}"
security_groups = ["${var.sg_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 = 300
}
instances = aws_instance.webservers[*].id
cross_zone_load_balancing = true
idle_timeout = 400
connection_draining = true
connection_draining_timeout = 400
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment