-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathr-subnet.tf
60 lines (48 loc) · 1.77 KB
/
r-subnet.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
moved {
from = azurerm_subnet.subnet
to = azurerm_subnet.main
}
resource "azurerm_subnet" "main" {
name = local.name
resource_group_name = var.resource_group_name
virtual_network_name = var.virtual_network_name
address_prefixes = var.cidrs
service_endpoints = var.service_endpoints
service_endpoint_policy_ids = var.service_endpoint_policy_ids
dynamic "delegation" {
for_each = var.delegations
content {
name = delegation.key
dynamic "service_delegation" {
for_each = toset(delegation.value)
content {
name = service_delegation.value.name
actions = service_delegation.value.actions
}
}
}
}
private_endpoint_network_policies = coalesce(var.private_endpoint_network_policies, var.private_link_endpoint_enabled ? "Enabled" : "Disabled")
private_link_service_network_policies_enabled = var.private_link_service_enabled
default_outbound_access_enabled = var.default_outbound_access_enabled
}
resource "azurerm_subnet_network_security_group_association" "main" {
count = var.network_security_group_name == null ? 0 : 1
subnet_id = azurerm_subnet.main.id
network_security_group_id = local.network_security_group_id
}
moved {
from = azurerm_subnet_network_security_group_association.subnet_association
to = azurerm_subnet_network_security_group_association.main
}
resource "azurerm_subnet_route_table_association" "main" {
count = var.route_table_name == null ? 0 : 1
subnet_id = azurerm_subnet.main.id
route_table_id = local.route_table_id
}
moved {
from = azurerm_subnet_route_table_association.route_table_association
to = azurerm_subnet_route_table_association.main
}
data "azurerm_subscription" "main" {
}