Public/IaaS/bastionhost/New-CmAzIaasBastionHost.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "Location": { "defaultValue": "[resourceGroup().location]", "type": "String", "metadata": { "description": "location" } }, "BastionHostObject": { "type": "Object", "metadata": { "description": "Bastion Host object with all required parameters" } }, "Workspace": { "type": "object", "metadata": { "description": "Hashtable containing workspace name and resourceID" } } }, "resources": [ { "type": "Microsoft.Resources/Deployments", "apiVersion": "2019-10-01", "name": "[concat(parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionHostName, copyIndex('BastionHostCopy'))]", "copy": { "name": "BastionHostCopy", "count": "[length(parameters('BastionHostObject').bastionHosts)]" }, "properties": { "mode": "Incremental", "expressionEvaluationOptions": { "scope": "outer" }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { }, "resources": [ { "condition": "[not(empty(parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionHostSubnetPrefix))]", "type": "Microsoft.Network/virtualNetworks/subnets", "apiVersion": "2019-04-01", "name": "[concat(parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].vnetName, '/', 'AzureBastionSubnet')]", "location": "[parameters('Location')]", "properties": { "addressPrefix": "[parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionHostSubnetPrefix]" } }, { "apiVersion": "2019-02-01", "type": "Microsoft.Network/publicIpAddresses", "name": "[parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionPublicIPName]", "location": "[parameters('Location')]", "sku": { "name": "Standard" }, "properties": { "publicIPAllocationMethod": "static", "dnsSettings": { "domainNameLabel": "[parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionPublicIPName]", "fqdn": "[concat(parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionPublicIPName, '.eastus.cloudapp.azure.com')]" } } }, { "apiVersion": "2019-12-01", "type": "Microsoft.Network/bastionHosts", "name": "[parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionHostName]", "location": "[parameters('Location')]", "dependsOn": [ "[resourceId('Microsoft.Network/publicIpAddresses', parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionPublicIPName)]" ], "properties": { "ipConfigurations": [ { "name": "IpConf", "properties": { "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].vnetName, 'AzureBastionSubnet')]" }, "publicIPAddress": { "id": "[resourceId('Microsoft.Network/publicIpAddresses', parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionPublicIPName)]" } } } ] } }, { "condition": "[not(empty(parameters('Workspace').Name))]", "type": "Microsoft.Network/bastionHosts/Providers/DiagnosticSettings", "name": "[concat(parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionHostName, '/Microsoft.Insights/Service')]", "apiVersion": "2016-09-01", "location": "[parameters('Workspace').Location]", "dependsOn": [ "[resourceId('Microsoft.Network/bastionHosts', parameters('BastionHostObject').bastionHosts[copyIndex('BastionHostCopy')].bastionHostName)]" ], "properties": { "WorkspaceId": "[parameters('Workspace').ResourceId]", "logs": [ { "category": "BastionAuditLogs", "enabled": true, "retentionPolicy": { "enabled": true, "days": 30 } } ] } } ] } } } ], "outputs": { } } |