-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmain.tf
39 lines (34 loc) · 953 Bytes
/
main.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
36
37
38
39
//
// Module: tf_aws_elb/elb_http
//
// Provider specific configs
provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
}
// ELB Resource for Module
// A note about instances:
// - This module assumes your instances will be made
// by an ASG and the ASG will associate them with
// the ELB.
resource "aws_elb" "elb" {
name = "${var.elb_name}"
subnets = ["${var.subnet_az1}","${var.subnet_az2}"]
internal = "${var.elb_is_internal}"
security_groups = ["${var.elb_security_group}"]
listener {
instance_port = "${var.backend_port}"
instance_protocol = "${var.backend_protocol}"
lb_port = "${var.frontend_port}"
lb_protocol = "${var.frontend_protocol}"
}
health_check {
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 3
target = "${var.health_check_target}"
interval = 30
}
cross_zone_load_balancing = true
}