-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
29 lines (25 loc) · 893 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
resource "azurerm_virtual_network" "virtual-network" {
address_space = [var.network_cidr]
location = var.location
name = "${lower(var.project)}${lower(var.stage)}netvnetwork"
resource_group_name = var.resource_group
}
resource "azurerm_subnet" "subnet" {
for_each = var.subnets
address_prefixes = each.value.cidr
name = each.key
resource_group_name = var.resource_group
virtual_network_name = azurerm_virtual_network.virtual-network.name
service_endpoints = each.value.service_endpoints
dynamic "delegation" {
for_each = each.value.service_delegations
content {
name = delegation.key
service_delegation {
name = delegation.value.name
actions = delegation.value.actions
}
}
}
private_endpoint_network_policies = each.value.private_endpoint_network_policies
}