Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connectivity): custom Settings for Virtual Hub connection names #885

Merged
merged 4 commits into from
Feb 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions modules/connectivity/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1826,10 +1826,16 @@ locals {
for spoke_resource_id in distinct(concat(virtual_hub_config.config.spoke_virtual_network_resource_ids, virtual_hub_config.config.secure_spoke_virtual_network_resource_ids)) :
{
# Resource logic attributes
resource_id = "${local.virtual_hub_resource_id[location]}/hubVirtualNetworkConnections/peering-${uuidv5("url", spoke_resource_id)}"
resource_id = try(
"${local.virtual_hub_resource_id[location]}/hubVirtualNetworkConnections/${local.custom_settings.azurerm_virtual_hub_connection["virtual_wan"][location][spoke_resource_id].name}",
"${local.virtual_hub_resource_id[location]}/hubVirtualNetworkConnections/peering-${uuidv5("url", spoke_resource_id)}"
)
managed_by_module = local.deploy_virtual_hub_connection[location]
# Resource definition attributes
name = "peering-${uuidv5("url", spoke_resource_id)}"
name = try(
local.custom_settings.azurerm_virtual_hub_connection["virtual_wan"][location][spoke_resource_id].name,
"peering-${uuidv5("url", spoke_resource_id)}"
)
virtual_hub_id = local.virtual_hub_resource_id[location]
remote_virtual_network_id = spoke_resource_id
# Optional definition attributes
Expand Down