diff options
Diffstat (limited to 'elb.tf')
-rw-r--r-- | elb.tf | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,36 @@ +resource "aws_elb" "app_elb" { + name = "${var.vpc_name}_app_elb" + + access_logs { + bucket = "${aws_s3_bucket.elb_logs.name}" + bucket_prefix = "app_logs" + 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" + interval = 5 + } + + cross_zone_load_balancing = true + idle_timeout = 400 + connection_draining = true + connetion_draining_timeout = 400 + security_groups = ["${aws_security_group.app_sg.id}"] + + subnets = [ + "${aws_subnet.public_1.id}", + "${aws_subnet.public_2.id}", + "${aws_subnet.public_3.id}", + ] +} |