terraform-azurerm-lz-vending
terraform-azurerm-lz-vending copied to clipboard
feat: force peer resynch when VNET extended
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Is your feature request related to an issue? Feature Request
When a peered VNET is extended the peer needs to be resync'ed. The native Terraform modules force a resync when a VNET is extended. The Microsoft modules do not.
Describe the solution you'd like
The Microsoft modules should force a resync on any peered VNETS where the range is changed ( extended or reduced.)
We are looking to implement a workaround in Powershell that will get a list of all VNETS. Check to see if the PeeringSyncLevel is RemoteNotInSync and if it is pass the VNET name to Sync-AzVirtualNetworkPeering to force the peer sync.
Additional context
Hi @fearofweapons
This is a sensible suggestion. Leave it with us to see if we can implement.
Voted for this, and it would be great to have this feature added.
I had a ta-da moment today on how we can implement.
Will report back!
I have proved this works in a poc, will work on adding this to a future release
PoC is here:
https://www.youtube.com/watch?v=5_39Ed5Lx1E
and here: https://github.com/matt-FFFFFF/terraform-azapi-vnet-peer-resync
Will look to get this added as a feature
Outstanding - thanks Matt -- really appreciated. We'll take a look and have a go at using this in our deployments as soon as we can!
incredibly good work - thanks for that! Do you btw already have an idea how and when it will go into the module? We use the module and are currently facing this challenge. We are already thinking about a PS script as a workaround that syncs the peerings again. The only question I have is whether I could trigger this in a meaningful way?
incredibly good work - thanks for that! Do you btw already have an idea how and when it will go into the module? We use the module and are currently facing this challenge. We are already thinking about a PS script as a workaround that syncs the peerings again. The only question I have is whether I could trigger this in a meaningful way?
I went for a workaround. As our landingzone deployment is made with an azure devops release pipeline I added a step which calls a webhook from an automation runbook. This runbook iterates over all peerings in the HUB and initiate a resync if not fully in sync