-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
28 lines (22 loc) · 891 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
resource "google_network_connectivity_hub" "hub" {
name = "${var.prefix}-hub"
}
module "ncc_region" {
source = "./ncc-region"
for_each = toset( var.regions )
region = each.key
prefix = var.prefix
hub = google_network_connectivity_hub.hub
indx = index(var.regions, each.key)
net_left = google_compute_network.left
net_right = google_compute_network.right
net_fgsp = google_compute_network.fgsp
asn_left_ncc = var.asns_left_ncc[index(var.regions, each.key)]
asn_right_ncc = var.asns_right_ncc[index(var.regions, each.key)]
asn_fgt = var.asns_fgt[index(var.regions, each.key)]
// custom_ip_ranges = var.wrkld_cidrs[each.key] #single region annoncements
custom_ip_ranges = flatten(values(var.wrkld_cidrs))
}
output "frontend_eips" {
value = [ for ncc in module.ncc_region : ncc.frontend_eip ]
}