-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
80 lines (61 loc) · 1.6 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
provider "aws" {
region = "us-east-1"
}
data "aws_vpc" "default" {
default = true
}
data "aws_subnet" "default" {
for_each = toset(["use1-az1", "use1-az2"])
availability_zone_id = each.key
default_for_az = true
}
###################################################
# Gateway Load Balancer
###################################################
module "gwlb" {
source = "../../modules/gwlb"
# source = "tedilabs/load-balancer/aws//modules/gwlb"
# version = "~> 1.0.0"
name = "tedilabs-gwlb-instance"
network_mapping = {
for az, subnet in data.aws_subnet.default :
az => {
subnet = subnet.id
}
}
## Attributes
cross_zone_load_balancing_enabled = true
deletion_protection_enabled = false
listeners = [{
port = 6081
target_group = module.target_group.arn
}]
tags = {
"project" = "terraform-aws-load-balancer-examples"
}
}
###################################################
# Instance Target Group for Gateway Load Balancer
###################################################
module "target_group" {
source = "../../modules/gwlb-instance-target-group"
# source = "tedilabs/load-balancer/aws//modules/gwlb-instance-target-group"
# version = "~> 1.0.0"
name = "tedilabs-gwlb-instance-tg"
vpc_id = data.aws_vpc.default.id
targets = [
# {
# instance = "i-xxxx"
# },
]
health_check = {
protocol = "HTTP"
port = 80
port_override = true
path = "/health"
interval = 10
timeout = 5
healthy_threshold = 3
unhealthy_threshold = 3
}
}