Skip to content

Commit

Permalink
Update passing zones to public IP
Browse files Browse the repository at this point in the history
  • Loading branch information
krbar committed Sep 23, 2024
1 parent a8b885a commit 776a73e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions avm/res/network/bastion-host/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ param enableTelemetry bool = true
2
3
])
param zones int[] = []
param zones int[] = [] // Availability Zones are currently in preview and only available in certain regions, therefore the default is an empty array.

// ----------------------------------------------------------------------------
// Prep ipConfigurations object AzureBastionSubnet for different uses cases:
Expand Down Expand Up @@ -166,7 +166,7 @@ module publicIPAddress 'br/public:avm/res/network/public-ip-address:0.6.0' = if
skuName: publicIPAddressObject.?skuName
skuTier: publicIPAddressObject.?skuTier
tags: publicIPAddressObject.?tags ?? tags
zones: publicIPAddressObject.?zones ?? zones
zones: publicIPAddressObject.?zones ?? (length(zones) > 0 ? zones : null) // if zones of the Public IP is empty, use the zones from the bastion host only if not empty (if empty, the default of the public IP will be used)
}
}

Expand Down
6 changes: 3 additions & 3 deletions avm/res/network/bastion-host/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "8505010148342282976"
"version": "0.30.3.12046",
"templateHash": "5049621611756899833"
},
"name": "Bastion Hosts",
"description": "This module deploys a Bastion Host.",
Expand Down Expand Up @@ -528,7 +528,7 @@
"value": "[coalesce(tryGet(parameters('publicIPAddressObject'), 'tags'), parameters('tags'))]"
},
"zones": {
"value": "[coalesce(tryGet(parameters('publicIPAddressObject'), 'zones'), parameters('zones'))]"
"value": "[coalesce(tryGet(parameters('publicIPAddressObject'), 'zones'), if(greater(length(parameters('zones')), 0), parameters('zones'), null()))]"
}
},
"template": {
Expand Down

0 comments on commit 776a73e

Please sign in to comment.