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

Type Validation Incorrect for vwanConnectivity Module #780

Closed
lsuarez5280 opened this issue May 9, 2024 · 1 comment · Fixed by #797
Closed

Type Validation Incorrect for vwanConnectivity Module #780

lsuarez5280 opened this issue May 9, 2024 · 1 comment · Fixed by #797
Labels
Area: Networking 🌐 Issues / PR's related to Networking

Comments

@lsuarez5280
Copy link

What happened? Provide a clear and concise description of the bug, including deployment details.

When attempting to deploy Virtual WAN Hub connectivity using AS-Path routing preference for my hubs, I am presented with a validation error for providing the correct configuration value of ASPath, incorrectly indicating that I should choose instead ASN.

There is an error in the current type definition for the module:

  @sys.description('The Virtual WAN Hub routing preference. The allowed values are `ASN`, `VpnGateway`, `ExpressRoute`.')
  parHubRoutingPreference: ('ExpressRoute' | 'VpnGateway' | 'ASN')

Note the documentation for the ARM API version in use indicates the following enumerated values:

Name Description Value
hubRoutingPreference The hubRoutingPreference of this VirtualHub. 'ASPath'
'ExpressRoute'
'VpnGateway'

The raw value is used directly in the module resource declaration as opposed to being mapped from ASN to the correct value, as replicated below:

resource resVhub 'Microsoft.Network/virtualHubs@2023-04-01' = [for hub in parVirtualWanHubs: if (parVirtualHubEnabled && !empty(hub.parVirtualHubAddressPrefix)) {
  name: hub.?parVirtualWanHubCustomName ?? '${parVirtualWanHubName}-${hub.parHubLocation}'
  location: hub.parHubLocation
  tags: parTags
  properties: {
    addressPrefix: hub.parVirtualHubAddressPrefix
    sku: 'Standard'
    virtualWan: {
      id: resVwan.id
    }
    virtualRouterAutoScaleConfiguration: {
      minCapacity: hub.parVirtualRouterAutoScaleConfiguration
    }
    hubRoutingPreference: hub.parHubRoutingPreference
  }
}]

Please provide the correlation id associated with your error or bug.

N/A for preflight template validation

What was the expected outcome?

Type validation should conform to the API version in use or map from the input value to a correct value for the API.

Relevant log output

New-AzResourceGroupDeployment: /home/vsts/work/1/s/pipeline-scripts/Deploy-ALZHub-VWAN.ps1:30
Line |
  30 |  New-AzResourceGroupDeployment @inputObject
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 14:53:06 - Error: Code=InvalidTemplate; Message=Deployment template
     | validation failed: 'The provided value for the template parameter
     | 'parVirtualWanHubs[0].parHubRoutingPreference' is not valid. The value
     | 'ASPath' is not part of the allowed value(s):
     | 'ASN,ExpressRoute,VpnGateway'.'.


### Check previous GitHub issues

- [X] I have searched the issues for this item and found no duplicate

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
@lsuarez5280 lsuarez5280 added the bug label May 9, 2024
@lsuarez5280 lsuarez5280 changed the title Type Validation Incorrect for Type Validation Incorrect for vwanConnectivity Module May 9, 2024
@oZakari
Copy link
Contributor

oZakari commented May 13, 2024

Thanks for calling this out @lsuarez5280, I will work on getting this in. We would also welcome a PR from you as well if you're interested.

@oZakari oZakari added the Area: Networking 🌐 Issues / PR's related to Networking label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Networking 🌐 Issues / PR's related to Networking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants