summaryrefslogtreecommitdiffstats
path: root/elb.tf
diff options
context:
space:
mode:
authorSpike <avlampson+git@gmail.com>2019-04-07 22:03:31 +0100
committerSpike <avlampson+git@gmail.com>2019-04-07 22:03:31 +0100
commitbb81085619769aca861ab5d5bbff86f71c9435d2 (patch)
tree80b45de34d9f0647c10e6d6fae5b408c21c190c5 /elb.tf
downloadfundapp_demo-master.zip
fundapp_demo-master.tar.gz
fundapp_demo-master.tar.bz2
Autoscaling Group, and associated controls and configsHEADmaster
Diffstat (limited to 'elb.tf')
-rw-r--r--elb.tf36
1 files changed, 36 insertions, 0 deletions
diff --git a/elb.tf b/elb.tf
new file mode 100644
index 0000000..69a090a
--- /dev/null
+++ b/elb.tf
@@ -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}",
+ ]
+}