Skip to content

Commit c17a982

Browse files
added secondary location as per AVM module
1 parent 94ff525 commit c17a982

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

infra/main.bicep

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ param solutionName string = 'kmgs'
99
@description('Optional. Azure location for the solution. If not provided, it defaults to the resource group location.')
1010
param location string = ''
1111

12+
@minLength(3)
13+
@description('Optional. Secondary location for databases creation.')
14+
param secondaryLocation string = 'uksouth'
15+
1216
@maxLength(5)
1317
@description('Optional. A unique token for the solution. This is used to ensure resource names are unique for global resources. Defaults to a 5-character substring of the unique string generated from the subscription ID, resource group name, and solution name.')
1418
param solutionUniqueToken string = substring(uniqueString(subscription().id, resourceGroup().name, solutionName), 0, 5)
@@ -138,7 +142,7 @@ var replicaRegionPairs = {
138142
uksouth: 'westeurope'
139143
westeurope: 'northeurope'
140144
}
141-
var replicaLocation = replicaRegionPairs[solutionLocation]
145+
var replicaLocation = replicaRegionPairs[?solutionLocation] ?? secondaryLocation
142146

143147
// Region pairs list based on article in [Azure Database for MySQL Flexible Server - Azure Regions](https://learn.microsoft.com/azure/mysql/flexible-server/overview#azure-regions) for supported high availability regions for CosmosDB.
144148
var cosmosDbZoneRedundantHaRegionPairs = {

infra/main.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.40.2.10011",
9-
"templateHash": "8417814553440700358"
9+
"templateHash": "454231766837079804"
1010
}
1111
},
1212
"parameters": {
@@ -26,6 +26,14 @@
2626
"description": "Optional. Azure location for the solution. If not provided, it defaults to the resource group location."
2727
}
2828
},
29+
"secondaryLocation": {
30+
"type": "string",
31+
"defaultValue": "uksouth",
32+
"minLength": 3,
33+
"metadata": {
34+
"description": "Optional. Secondary location for databases creation."
35+
}
36+
},
2937
"solutionUniqueToken": {
3038
"type": "string",
3139
"defaultValue": "[substring(uniqueString(subscription().id, resourceGroup().name, parameters('solutionName')), 0, 5)]",
@@ -207,7 +215,7 @@
207215
"uksouth": "westeurope",
208216
"westeurope": "northeurope"
209217
},
210-
"replicaLocation": "[variables('replicaRegionPairs')[variables('solutionLocation')]]",
218+
"replicaLocation": "[coalesce(tryGet(variables('replicaRegionPairs'), variables('solutionLocation')), parameters('secondaryLocation'))]",
211219
"cosmosDbZoneRedundantHaRegionPairs": {
212220
"australiaeast": "uksouth",
213221
"centralus": "eastus2",
@@ -44130,7 +44138,7 @@
4413044138
"value": "[parameters('enableTelemetry')]"
4413144139
},
4413244140
"kubernetesVersion": {
44133-
"value": "1.32.7"
44141+
"value": "1.34.2"
4413444142
},
4413544143
"dnsPrefix": {
4413644144
"value": "[format('aks-{0}', variables('solutionSuffix'))]"

0 commit comments

Comments
 (0)