Skip to content

Commit

Permalink
fix: [avm-ptn-lz-sub-vending] Add improvements to the vwan connection…
Browse files Browse the repository at this point in the history
…s naming convention (#3110)

## Description

Fixes #3085 
<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes #123
Fixes #456
Closes #123
Closes #456
-->

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.ptn.lz.sub-vending](https://github.com/sebassem/bicep-registry-modules/actions/workflows/avm.ptn.lz.sub-vending.yml/badge.svg?branch=avm-ptn-lz-sub-vending-vwan-connection-name)](https://github.com/sebassem/bicep-registry-modules/actions/workflows/avm.ptn.lz.sub-vending.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [X] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [X] I'm sure there are no other open Pull Requests for the same
update/change
- [X] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [X] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
sebassem authored Sep 11, 2024
1 parent 97f616f commit 4d7c891
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
70 changes: 35 additions & 35 deletions avm/ptn/lz/sub-vending/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "11010234208010675398"
"version": "0.29.47.4906",
"templateHash": "2409780926109914899"
},
"name": "Sub-vending",
"description": "This module deploys a subscription to accelerate deployment of landing zones. For more information on how to use it, please visit this [Wiki](https://github.com/Azure/bicep-lz-vending/wiki).",
Expand Down Expand Up @@ -445,8 +445,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "3306118610933947345"
"version": "0.29.47.4906",
"templateHash": "3759867594724381121"
}
},
"parameters": {
Expand Down Expand Up @@ -652,8 +652,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "15097801658394168144"
"version": "0.29.47.4906",
"templateHash": "10394721304346895394"
},
"name": "`/subResourcesWrapper/deploy.bicep` Parameters",
"description": "This module is used by the [`bicep-lz-vending`](https://aka.ms/sub-vending/bicep) module to help orchestrate the deployment",
Expand Down Expand Up @@ -992,7 +992,7 @@
"virtualWanHubName": "[if(not(empty(variables('virtualHubResourceIdChecked'))), split(variables('virtualHubResourceIdChecked'), '/')[8], '')]",
"virtualWanHubSubscriptionId": "[if(not(empty(variables('virtualHubResourceIdChecked'))), split(variables('virtualHubResourceIdChecked'), '/')[2], '')]",
"virtualWanHubResourceGroupName": "[if(not(empty(variables('virtualHubResourceIdChecked'))), split(variables('virtualHubResourceIdChecked'), '/')[4], '')]",
"virtualWanHubConnectionName": "[format('vhc-{0}', guid(variables('virtualHubResourceIdChecked'), parameters('virtualNetworkName'), parameters('virtualNetworkResourceGroupName'), parameters('virtualNetworkLocation'), parameters('subscriptionId')))]",
"virtualWanHubConnectionName": "[format('vhc-{0}-{1}', parameters('virtualNetworkName'), substring(guid(variables('virtualHubResourceIdChecked'), parameters('virtualNetworkName'), parameters('virtualNetworkResourceGroupName'), parameters('virtualNetworkLocation'), parameters('subscriptionId')), 0, 5))]",
"virtualWanHubConnectionAssociatedRouteTable": "[if(not(empty(parameters('virtualNetworkVwanAssociatedRouteTableResourceId'))), parameters('virtualNetworkVwanAssociatedRouteTableResourceId'), format('{0}/hubRouteTables/defaultRouteTable', variables('virtualHubResourceIdChecked')))]",
"virutalWanHubDefaultRouteTableId": {
"id": "[format('{0}/hubRouteTables/defaultRouteTable', variables('virtualHubResourceIdChecked'))]"
Expand Down Expand Up @@ -1028,8 +1028,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "9313475896614087193"
"version": "0.29.47.4906",
"templateHash": "13961984943235030681"
}
},
"parameters": {
Expand Down Expand Up @@ -1086,8 +1086,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "15181721731905574940"
"version": "0.29.47.4906",
"templateHash": "6592820624705341105"
}
},
"parameters": {
Expand Down Expand Up @@ -1146,8 +1146,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "2065450289597496523"
"version": "0.29.47.4906",
"templateHash": "3589833223987550845"
}
},
"parameters": {
Expand Down Expand Up @@ -1202,8 +1202,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "4876221897054252048"
"version": "0.29.47.4906",
"templateHash": "15687156082548283745"
}
},
"parameters": {
Expand All @@ -1222,7 +1222,7 @@
"metadata": {
"description": "Tags currently applied to the subscription level"
},
"value": "[if(contains(reference(subscriptionResourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01'), 'tags'), reference(subscriptionResourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01').tags, createObject())]"
"value": "[coalesce(tryGet(reference(subscriptionResourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01'), 'tags'), createObject())]"
}
}
}
Expand Down Expand Up @@ -1280,8 +1280,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "10772346649778391302"
"version": "0.29.47.4906",
"templateHash": "2885361202003966670"
}
},
"parameters": {
Expand Down Expand Up @@ -1335,8 +1335,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "943757300004366392"
"version": "0.29.47.4906",
"templateHash": "4327209924100539632"
}
},
"parameters": {
Expand All @@ -1355,7 +1355,7 @@
"metadata": {
"description": "Tags currently applied to the subscription level"
},
"value": "[if(contains(reference(resourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01'), 'tags'), reference(resourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01').tags, createObject())]"
"value": "[coalesce(tryGet(reference(resourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01'), 'tags'), createObject())]"
}
}
}
Expand Down Expand Up @@ -1915,8 +1915,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "15181721731905574940"
"version": "0.29.47.4906",
"templateHash": "6592820624705341105"
}
},
"parameters": {
Expand Down Expand Up @@ -1975,8 +1975,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "2065450289597496523"
"version": "0.29.47.4906",
"templateHash": "3589833223987550845"
}
},
"parameters": {
Expand Down Expand Up @@ -2031,8 +2031,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "4876221897054252048"
"version": "0.29.47.4906",
"templateHash": "15687156082548283745"
}
},
"parameters": {
Expand All @@ -2051,7 +2051,7 @@
"metadata": {
"description": "Tags currently applied to the subscription level"
},
"value": "[if(contains(reference(subscriptionResourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01'), 'tags'), reference(subscriptionResourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01').tags, createObject())]"
"value": "[coalesce(tryGet(reference(subscriptionResourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01'), 'tags'), createObject())]"
}
}
}
Expand Down Expand Up @@ -2109,8 +2109,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "10772346649778391302"
"version": "0.29.47.4906",
"templateHash": "2885361202003966670"
}
},
"parameters": {
Expand Down Expand Up @@ -2164,8 +2164,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "943757300004366392"
"version": "0.29.47.4906",
"templateHash": "4327209924100539632"
}
},
"parameters": {
Expand All @@ -2184,7 +2184,7 @@
"metadata": {
"description": "Tags currently applied to the subscription level"
},
"value": "[if(contains(reference(resourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01'), 'tags'), reference(resourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01').tags, createObject())]"
"value": "[coalesce(tryGet(reference(resourceId('Microsoft.Resources/tags', parameters('name')), '2019-10-01'), 'tags'), createObject())]"
}
}
}
Expand Down Expand Up @@ -3487,8 +3487,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.28.1.47646",
"templateHash": "15855049387961116888"
"version": "0.29.47.4906",
"templateHash": "3320668363507906643"
}
},
"parameters": {
Expand Down
2 changes: 1 addition & 1 deletion avm/ptn/lz/sub-vending/modules/readTagsResourceGroup.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ resource tags 'Microsoft.Resources/tags@2019-10-01' existing = {
}

@description('Tags currently applied to the subscription level')
output existingTags object = contains(tags.properties, 'tags') ? tags.properties.tags : {}
output existingTags object = tags.properties.?tags ?? {}
2 changes: 1 addition & 1 deletion avm/ptn/lz/sub-vending/modules/readTagsSubscription.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ resource tags 'Microsoft.Resources/tags@2019-10-01' existing = {
}

@description('Tags currently applied to the subscription level')
output existingTags object = contains(tags.properties, 'tags') ? tags.properties.tags : {}
output existingTags object = tags.properties.?tags ?? {}
2 changes: 1 addition & 1 deletion avm/ptn/lz/sub-vending/modules/subResourceWrapper.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ var virtualWanHubSubscriptionId = (!empty(virtualHubResourceIdChecked) ? split(v
var virtualWanHubResourceGroupName = (!empty(virtualHubResourceIdChecked)
? split(virtualHubResourceIdChecked, '/')[4]
: '')
var virtualWanHubConnectionName = 'vhc-${guid(virtualHubResourceIdChecked, virtualNetworkName, virtualNetworkResourceGroupName, virtualNetworkLocation, subscriptionId)}'
var virtualWanHubConnectionName = 'vhc-${virtualNetworkName}-${substring(guid(virtualHubResourceIdChecked, virtualNetworkName, virtualNetworkResourceGroupName, virtualNetworkLocation, subscriptionId), 0, 5)}'
var virtualWanHubConnectionAssociatedRouteTable = !empty(virtualNetworkVwanAssociatedRouteTableResourceId)
? virtualNetworkVwanAssociatedRouteTableResourceId
: '${virtualHubResourceIdChecked}/hubRouteTables/defaultRouteTable'
Expand Down

0 comments on commit 4d7c891

Please sign in to comment.