-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
43 lines (34 loc) · 1.39 KB
/
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
37
38
39
40
41
42
43
resource "azurerm_subnet" "this" {
count = var.create_subnets ? 1 : 0
name = var.name
resource_group_name = var.resource_group_name
virtual_network_name = var.virtual_network_name
address_prefixes = var.address_prefixes
dynamic "delegation" {
for_each = var.delegation
content {
name = try(delegation.value.name)
dynamic "service_delegation" {
for_each = try(delegation.value.service_delegation)
content {
name = try(service_delegation.value.name)
actions = try(service_delegation.value.actions, [])
}
}
}
}
private_endpoint_network_policies_enabled = var.private_endpoint_network_policies_enabled
private_link_service_network_policies_enabled = var.private_link_service_network_policies_enabled
service_endpoints = var.service_endpoints
service_endpoint_policy_ids = var.service_endpoint_policy_ids
}
resource "azurerm_subnet_nat_gateway_association" "this" {
count = var.associate_nat_gateway ? 1 : 0
subnet_id = azurerm_subnet.this[0].id
nat_gateway_id = var.nat_gateway_id
}
resource "azurerm_subnet_network_security_group_association" "this" {
count = var.associate_nsg ? 1 : 0
subnet_id = azurerm_subnet.this[0].id
network_security_group_id = var.network_security_group_id
}