Azure / terraform-azurerm-avm-res-network-virtualnetwork

Azure Verified Module for Virtual Network
https://registry.terraform.io/modules/Azure/avm-res-network-virtualnetwork
MIT License
20 stars 15 forks source link

[AVM Question/Feedback]: Peerings fail with a missing feature, but the feature appears registered #111

Closed SvenAelterman closed 1 month ago

SvenAelterman commented 1 month ago

Check for previous/existing GitHub issues

Description

When specifying peerings, I am getting an error that the Microsoft.Network/AllowMultiplePeeringLinksBetweenVnets feature isn't registered.

However, when I run Get-AzProviderFeature -ProviderNamespace Microsoft.Network -FeatureName AllowMultiplePeeringLinksBetweenVnets, the state shows as Registered for the subscription where the error applies.

What can I do to resolve this issue?

SvenAelterman commented 1 month ago

OK, interesting. I checked on the remote side and the feature was not registered there. Even though the Terraform error clearly indicated that the subscription ID where it said the feature wasn't registered was the local side.

I went ahead and registered the feature on the remote side and then re-ran Terraform.

I am no longer getting that error, but now there's a different error, on both peerings:

│ --------------------------------------------------------------------------------
│ RESPONSE 400: 400 Bad Request
│ ERROR CODE: LocalAndRemoteSpaceMustContainEitherIpv4orIpv6Prefix
│ --------------------------------------------------------------------------------
│ {
│   "error": {
│     "code": "LocalAndRemoteSpaceMustContainEitherIpv4orIpv6Prefix",
│     "message": "Cannot create or update peering /subscriptions/fca9eaf6-728a-4252-9e2d-aa2532c82614/resourceGroups/network-demo-rg-cnc-01/providers/Microsoft.Network/virtualNetworks/hub-demo-vnet-cnc-01/virtualNetworkPeerings/hub-to-identity. Both Local and Remote Address Space in a Virtual Network Peering must contain either atleast one IPv4 in both or IPv6 prefix in both. Peered Spaces are, Local Address Space:  and Remote Address Space: ",
│     "details": []
│   }
│ }
│ --------------------------------------------------------------------------------

(I have also tried manually creating the peerings and that works.)

jaredfholgate commented 1 month ago

Let me check on this, we added a capability to register features for preview features. All our examples work successfully, so would be useful to see your Terraform code to be able to reproduce.

Arhughes14 commented 3 days ago

@SvenAelterman ERROR CODE: LocalAndRemoteSpaceMustContainEitherIpv4orIpv6Prefix. How did you resolve this error?

jaredfholgate commented 2 days ago

@SvenAelterman ERROR CODE: LocalAndRemoteSpaceMustContainEitherIpv4orIpv6Prefix. How did you resolve this error?

This should have been fixed in v0.4.0