Skip to content

Commit

Permalink
fix: use the submodule as per changes in AVM upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
kewalaka committed May 25, 2024
1 parent 3ecca13 commit 804d4d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
1 change: 0 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ locals {
}, sv.route_table, {})
}
)
if !(sv == "network_security_group_key" || sv == "route_table_key")
}
}
24 changes: 17 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
module "subnets" {
for_each = var.subnets
for_each = local.subnets

# TODO revert to Azure org pending fix: https://github.com/Azure/terraform-azurerm-avm-res-network-virtualnetwork/pull/74
source = "git::https://github.com/kewalaka/terraform-azurerm-avm-res-network-virtualnetwork?ref=dev"
# source = "Azure/avm-res-network-virtualnetwork/azurerm"
source = "git::https://github.com/kewalaka/terraform-azurerm-avm-res-network-virtualnetwork//modules/subnet?ref=feat/use-azapi-for-subnets"
# source = "Azure/avm-res-network-virtualnetwork/modules/subnet/azurerm"
# version = "0.2.0"

existing_vnet = {
virtual_network = {
resource_id = var.virtual_network_resource_id
}
location = var.location
resource_group_name = var.resource_group_name
subnets = local.subnets
name = each.value.name
address_prefixes = each.value.address_prefixes

default_outbound_access_enabled = try(each.value.default_outbound_access_enabled, false)
delegation = try(each.value.delegation, null)
nat_gateway = try(each.value.nat_gateway, null)
network_security_group = each.value.network_security_group
private_endpoint_network_policies = coalesce(each.value.private_endpoint_network_policies, "Enabled")
private_link_service_network_policies_enabled = coalesce(each.value.private_link_service_network_policies_enabled, true)
role_assignments = try(each.value.role_assignments, {})
route_table = each.value.route_table
service_endpoint_policies = try(each.value.service_endpoint_policies, null)
service_endpoints = try(each.value.service_endpoints, null)

depends_on = [module.network_security_groups]
}
Expand Down

0 comments on commit 804d4d3

Please sign in to comment.