-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
36 lines (34 loc) · 983 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
# This Terraform configuration defines resources and a module for deploying an Azure Virtual WAN setup.
resource "azurerm_resource_group" "this" {
name = var.resource_group.name
location = var.resource_group.location
tags = merge(
try(var.tags),
tomap({
"Resource Type" = "Resource Group"
})
)
}
resource "azurerm_virtual_wan" "this" {
name = var.virtual_wan.name
resource_group_name = azurerm_resource_group.this.name
location = coalesce(var.virtual_wan.location, azurerm_resource_group.this.location)
tags = merge(
try(var.tags),
tomap({
"Resource Type" = "Virtual WAN"
})
)
}
module "vhub" {
for_each = var.virtual_hubs
source = "./modules/vhub"
virtual_hubs = var.virtual_hubs[each.key]
virtual_wan_id = azurerm_virtual_wan.this.id
resource_group_name = azurerm_resource_group.this.name
tags = merge(
try(var.tags),
tomap({
})
)
}