-
Notifications
You must be signed in to change notification settings - Fork 1
/
locals.tf
29 lines (27 loc) · 1.02 KB
/
locals.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
locals {
private_subnet = cidrsubnet(var.local_network, 8, 1)
public_subnet = cidrsubnet(var.local_network, 8, 101)
graphite_host = cidrhost(local.private_subnet, 200)
nlb_count = ceil((var.instance_count + (var.grafana_enabled ? 1 : 0)) / var.instance_count_per_lb)
instance_count_per_lb = min(49, var.instance_count_per_lb)
tags = merge(
var.tags,
{
"Name" = var.name
"Environment" = "xlt"
},
)
agent_controller_urls = { for id in range(var.instance_count) :
format("%03d", id) => format("https://%s:%s",
aws_lb.this[ceil((id + 1) / local.instance_count_per_lb) - 1].dns_name,
aws_lb_listener.this[id].port
)
}
agent_controller_blocks = [for index, url in local.agent_controller_urls :
<<-EOT
com.xceptance.xlt.mastercontroller.agentcontrollers.ac${index}.url = ${url}
com.xceptance.xlt.mastercontroller.agentcontrollers.ac${index}.weight = 1
com.xceptance.xlt.mastercontroller.agentcontrollers.ac${index}.agents = 2
EOT
]
}