forked from terraform-community-modules/tf_aws_elb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
40 lines (35 loc) · 969 Bytes
/
main.tf
File metadata and controls
40 lines (35 loc) · 969 Bytes
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
40
//
// Module: tf_aws_elb/elb_https
//
// 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 = 443
lb_protocol = "https"
ssl_certificate_id = "${var.ssl_certificate_id}"
}
health_check {
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 3
target = "${var.health_check_target}"
interval = 30
}
cross_zone_load_balancing = true
}