Skip to content

Commit

Permalink
Replace resourceGroup().location with the location parameter (top-lev…
Browse files Browse the repository at this point in the history
…el only)
  • Loading branch information
Hosung Song committed May 23, 2018
1 parent 1b8a9a2 commit 07c64e6
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 57 deletions.
12 changes: 10 additions & 2 deletions azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,13 @@
"description": "Loadbalancer SKU"
},
"type": "string"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Azure Location for all resources."
}
}
},
"resources": [
Expand Down Expand Up @@ -985,10 +992,11 @@
"ctlrPipName": "[concat('controller-pubip-',variables('resourceprefix'))]",
"ctlrVmName": "[concat('controller-vm-',variables('resourceprefix'))]",
"ctlrVmSecrets": "[take(variables('ctlrVmSecretsArray'), if(empty(parameters('keyVaultResourceId')), 0, 1))]",
"lbDns": "[concat('lb-',variables('resourceprefix'),'.',resourceGroup().location,'.cloudapp.azure.com')]",
"lbDns": "[concat('lb-',variables('resourceprefix'),'.',parameters('location'),'.cloudapp.azure.com')]",
"lbSku": "[parameters('loadBalancerSku')]",
"lbName": "[concat('lb-',variables('resourceprefix'))]",
"lbPipName": "[concat('lb-pubip-',variables('resourceprefix'))]",
"location": "[parameters('location')]",
"moodleAdminPass": "[concat(toUpper('xl'), substring(uniqueString(resourceGroup().id, deployment().name), 6, 7),',1*8')]",
"moodleDbName": "moodle",
"moodleDbPass": "[concat('9#36^', substring(uniqueString(resourceGroup().id, deployment().name), 5, 8), toUpper('ercq'))]",
Expand Down Expand Up @@ -1021,7 +1029,7 @@
"resourcesPrefix": "[variables('resourceprefix')]",
"searchType": "[parameters('searchType')]",
"serverName": "[concat(parameters('dbServerType'), '-',variables('resourceprefix'))]",
"siteURL": "[if(or(empty(parameters('siteURL')), equals(parameters('siteURL'), 'www.example.org')), concat(if(equals(parameters('httpsTermination'), 'AppGw'),'appgw-','lb-'),variables('resourceprefix'),'.',resourceGroup().location,'.cloudapp.azure.com'), parameters('siteURL'))]",
"siteURL": "[if(or(empty(parameters('siteURL')), equals(parameters('siteURL'), 'www.example.org')), concat(if(equals(parameters('httpsTermination'), 'AppGw'),'appgw-','lb-'),variables('resourceprefix'),'.',parameters('location'),'.cloudapp.azure.com'), parameters('siteURL'))]",
"sshPublicKey": "[parameters('sshPublicKey')]",
"sshUsername": "[parameters('sshUsername')]",
"sslEnforcement": "[parameters('sslEnforcement')]",
Expand Down
2 changes: 1 addition & 1 deletion nested/appgw.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"type": "Microsoft.Network/applicationGateways",
"name": "[parameters('moodleCommon').appGwName]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"apiVersion": "2018-02-01",
"properties": {
"sku": {
Expand Down
6 changes: 3 additions & 3 deletions nested/controller.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2017-10-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').ctlrNsgName]",
"properties": {
"securityRules": [
Expand Down Expand Up @@ -85,7 +85,7 @@
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', parameters('moodleCommon').ctlrNsgName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').ctlrNicName]",
"properties": {
"networkSecurityGroup": {
Expand Down Expand Up @@ -116,7 +116,7 @@
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('moodleCommon').ctlrNicName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').ctlrVmName]",
"properties": {
"hardwareProfile": {
Expand Down
2 changes: 1 addition & 1 deletion nested/controllerconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2017-03-30",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[concat(parameters('moodleCommon').ctlrVmName,'/','install_moodle')]",
"properties": {
"autoUpgradeMinorVersion": true,
Expand Down
6 changes: 3 additions & 3 deletions nested/db-mssql.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"type": "Microsoft.Sql/servers",
"apiVersion": "2015-05-01-preview",
"kind": "",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').serverName]",
"properties": {
"administratorLogin": "[parameters('moodleCommon').dbLogin]",
Expand All @@ -39,7 +39,7 @@
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('moodleCommon').serverName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "mssql-firewall-allow-lb",
"properties": {
"startIpAddress": "[parameters('lbPubIp')]",
Expand All @@ -52,7 +52,7 @@
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('moodleCommon').serverName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "mssql-firewall-allow-ctlr",
"properties": {
"startIpAddress": "[parameters('ctlrPubIp')]",
Expand Down
6 changes: 3 additions & 3 deletions nested/db-mysql.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"type": "Microsoft.DBforMySQL/servers",
"apiVersion": "2017-12-01",
"kind": "",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').serverName]",
"properties": {
"administratorLogin": "[parameters('moodleCommon').dbLogin]",
Expand All @@ -51,7 +51,7 @@
"dependsOn": [
"[concat('Microsoft.DBforMySQL/servers/', parameters('moodleCommon').serverName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "mysql-firewall-allow-lb",
"properties": {
"startIpAddress": "[parameters('lbPubIp')]",
Expand All @@ -64,7 +64,7 @@
"dependsOn": [
"[concat('Microsoft.DBforMySQL/servers/', parameters('moodleCommon').serverName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "mysql-firewall-allow-ctlr",
"properties": {
"startIpAddress": "[parameters('ctlrPubIp')]",
Expand Down
6 changes: 3 additions & 3 deletions nested/db-postgres.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"kind": "",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').serverName]",
"properties": {
"administratorLogin": "[parameters('moodleCommon').dbLogin]",
Expand All @@ -51,7 +51,7 @@
"dependsOn": [
"[concat('Microsoft.DBforPostgreSQL/servers/', parameters('moodleCommon').serverName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "postgres-firewall-allow-lb",
"properties": {
"startIpAddress": "[parameters('lbPubIp')]",
Expand All @@ -64,7 +64,7 @@
"dependsOn": [
"[concat('Microsoft.DBforPostgreSQL/servers/', parameters('moodleCommon').serverName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "postgres-firewall-allow-ctlr",
"properties": {
"startIpAddress": "[parameters('ctlrPubIp')]",
Expand Down
2 changes: 1 addition & 1 deletion nested/gluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
"type": "Microsoft.Compute/availabilitySets",
"apiVersion": "2017-03-30",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').gfxAvailabilitySetName]",
"properties": {
"platformFaultDomainCount": 2,
Expand Down
4 changes: 2 additions & 2 deletions nested/glustervm.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2017-10-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[variables('nicName')]",
"properties": {
"ipConfigurations": [
Expand All @@ -50,7 +50,7 @@
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[variables('vmName')]",
"properties": {
"availabilitySet": {
Expand Down
2 changes: 1 addition & 1 deletion nested/glustervmconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2017-03-30",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[concat(parameters('vmName'),'/','install_gluster')]",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
Expand Down
14 changes: 7 additions & 7 deletions nested/network-subnets.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2017-10-01",
"name": "[concat(parameters('vnetName'), '/', parameters('moodleCommon').subnetWeb)]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"properties": {
"addressPrefix": "[parameters('moodleCommon').subnetWebRange]"
}
Expand All @@ -29,7 +29,7 @@
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2017-10-01",
"name": "[concat(parameters('vnetName'), '/', parameters('moodleCommon').subnetSan)]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('moodleCommon').subnetWeb)]"
],
Expand All @@ -41,7 +41,7 @@
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2017-10-01",
"name": "[concat(parameters('vnetName'), '/', parameters('moodleCommon').subnetRedis)]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('moodleCommon').subnetSan)]"
],
Expand All @@ -53,7 +53,7 @@
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2017-10-01",
"name": "[concat(parameters('vnetName'), '/', parameters('moodleCommon').subnetElastic)]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('moodleCommon').subnetRedis)]"
],
Expand All @@ -65,7 +65,7 @@
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2017-10-01",
"name": "[concat(parameters('vnetName'), '/', parameters('moodleCommon').subnetTika)]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('moodleCommon').subnetElastic)]"
],
Expand All @@ -77,7 +77,7 @@
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2017-10-01",
"name": "[concat(parameters('vnetName'), '/', parameters('moodleCommon').subnetGateway)]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('moodleCommon').subnetTika)]"
],
Expand All @@ -89,7 +89,7 @@
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2017-10-01",
"name": "[concat(parameters('vnetName'), '/', parameters('moodleCommon').subnetAppGw)]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('moodleCommon').subnetGateway)]"
],
Expand Down
4 changes: 2 additions & 2 deletions nested/network-vnet-ddos.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"type": "Microsoft.Network/ddosProtectionPlans",
"apiVersion": "2018-02-01",
"condition": "[parameters('moodleCommon').ddosSwitch]",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').ddosPlanName]"
},
{
Expand All @@ -35,7 +35,7 @@
"dependsOn": [
"[resourceId('Microsoft.Network/ddosProtectionPlans', parameters('moodleCommon').ddosPlanName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('vnetName')]",
"properties": {
"addressSpace": {
Expand Down
2 changes: 1 addition & 1 deletion nested/network-vnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2017-10-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').vnetName]",
"properties": {
"addressSpace": {
Expand Down
12 changes: 6 additions & 6 deletions nested/network.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"condition": "[parameters('moodleCommon').vnetGwDeploySwitch]",
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2017-10-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').gatewayPublicIPName]",
"properties": {
"publicIPAllocationMethod": "Dynamic"
Expand All @@ -101,7 +101,7 @@
"[resourceId('Microsoft.Network/publicIPAddresses', parameters('moodleCommon').gatewayPublicIPName)]",
"Microsoft.Resources/deployments/subnetTemplate"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').gatewayName]",
"properties": {
"activeActive": false,
Expand Down Expand Up @@ -136,7 +136,7 @@
"name": "[parameters('moodleCommon').lbSku]"
},
"apiVersion": "2017-10-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').lbPipName]",
"properties": {
"dnsSettings": {
Expand All @@ -152,7 +152,7 @@
"condition": "[equals(parameters('moodleCommon').httpsTermination, 'AppGw')]",
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2017-10-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').appGwPipName]",
"properties": {
"dnsSettings": {
Expand All @@ -167,7 +167,7 @@
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2017-10-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').ctlrPipName]",
"properties": {
"dnsSettings": {
Expand All @@ -189,7 +189,7 @@
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/',parameters('moodleCommon').lbPipName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').lbName]",
"properties": {
"backendAddressPools": [
Expand Down
4 changes: 2 additions & 2 deletions nested/recoveryservices.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"type": "Microsoft.RecoveryServices/vaults",
"apiVersion": "2016-06-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').vaultName]",
"properties": {},
"sku": {
Expand All @@ -27,7 +27,7 @@
"dependsOn": [
"[concat('Microsoft.RecoveryServices/vaults/', parameters('moodleCommon').vaultName)]"
],
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[concat(parameters('moodleCommon').vaultName, '/', parameters('moodleCommon').policyName)]",
"properties": {
"backupManagementType": "AzureIaasVM",
Expand Down
2 changes: 1 addition & 1 deletion nested/recoveryservicesEnlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems",
"apiVersion": "2016-06-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[concat(parameters('moodleCommon').vaultName, '/', variables('backupFabric'), '/', variables('v2VmContainer'), concat(resourceGroup().name,';',parameters('vmName')), '/', variables('v2Vm'), concat(resourceGroup().name,';',parameters('vmName')))]",
"properties": {
"policyId": "[resourceId('Microsoft.RecoveryServices/vaults/backupPolicies',parameters('moodleCommon').vaultName,parameters('moodleCommon').policyName )]",
Expand Down
2 changes: 1 addition & 1 deletion nested/redis.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
"type": "Microsoft.Cache/Redis",
"apiVersion": "2016-04-01",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').redisCacheName]",
"properties": {
"enableNonSslPort": true,
Expand Down
2 changes: 1 addition & 1 deletion nested/search-azure.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
"type": "Microsoft.Search/searchServices",
"apiVersion": "2015-08-19",
"location": "[resourceGroup().location]",
"location": "[parameters('moodleCommon').location]",
"name": "[parameters('moodleCommon').azureSearchName]",
"sku": {
"name": "[parameters('moodleCommon').azureSearchSku]"
Expand Down
Loading

0 comments on commit 07c64e6

Please sign in to comment.