ARO-RP/deploy/cluster-development-predepl...

172 строки
6.5 KiB
JSON

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"ci": {
"type": "bool",
"defaultValue": false
},
"clusterName": {
"type": "string"
},
"clusterServicePrincipalId": {
"type": "string"
},
"fpServicePrincipalId": {
"type": "string"
},
"kvName": {
"type": "string"
},
"masterAddressPrefix": {
"type": "string"
},
"routes": {
"type": "array",
"defaultValue": []
},
"vnetAddressPrefix": {
"type": "string"
},
"workerAddressPrefix": {
"type": "string"
}
},
"resources": [
{
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('vnetAddressPrefix')]"
]
}
},
"name": "dev-vnet",
"type": "Microsoft.Network/virtualNetworks",
"location": "[resourceGroup().location]",
"condition": "[parameters('ci')]",
"apiVersion": "2020-08-01"
},
{
"properties": {
"routes": "[parameters('routes')]"
},
"name": "[concat(parameters('clusterName'), '-rt')]",
"type": "Microsoft.Network/routeTables",
"location": "[resourceGroup().location]",
"apiVersion": "2020-08-01"
},
{
"properties": {
"addressPrefix": "[parameters('masterAddressPrefix')]",
"routeTable": {
"id": "[resourceid('Microsoft.Network/routeTables', concat(parameters('clusterName'), '-rt'))]",
"tags": null
}
},
"name": "[concat('dev-vnet/', parameters('clusterName'), '-master')]",
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2020-08-01",
"dependsOn": [
"[resourceid('Microsoft.Network/virtualNetworks', 'dev-vnet')]",
"[resourceid('Microsoft.Network/routeTables', concat(parameters('clusterName'), '-rt'))]"
],
"location": "[resourceGroup().location]"
},
{
"properties": {
"addressPrefix": "[parameters('workerAddressPrefix')]",
"routeTable": {
"id": "[resourceid('Microsoft.Network/routeTables', concat(parameters('clusterName'), '-rt'))]",
"tags": null
}
},
"name": "[concat('dev-vnet/', parameters('clusterName'), '-worker')]",
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2020-08-01",
"dependsOn": [
"[resourceid('Microsoft.Network/virtualNetworks/subnets', 'dev-vnet', concat(parameters('clusterName'), '-master'))]",
"[resourceid('Microsoft.Network/routeTables', concat(parameters('clusterName'), '-rt'))]"
],
"location": "[resourceGroup().location]"
},
{
"name": "[parameters('kvName')]",
"type": "Microsoft.KeyVault/vaults",
"location": "[resourceGroup().location]",
"properties": {
"tenantId": "[subscription().tenantId]",
"sku": {
"family": "A",
"name": "standard"
},
"accessPolicies": [],
"enabledForDiskEncryption": true,
"enablePurgeProtection": true
},
"condition": "[parameters('ci')]",
"apiVersion": "2019-09-01"
},
{
"properties": {
"kty": "RSA",
"keySize": 4096
},
"name": "[concat(parameters('kvName'), '/', concat(resourceGroup().name, '-disk-encryption-key'))]",
"type": "Microsoft.KeyVault/vaults/keys",
"location": "[resourceGroup().location]",
"condition": "[parameters('ci')]",
"apiVersion": "2019-09-01",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults', parameters('kvName'))]"
]
},
{
"identity": {
"type": "SystemAssigned"
},
"properties": {
"activeKey": {
"sourceVault": {
"id": "[resourceId('Microsoft.KeyVault/vaults', parameters('kvName'))]"
},
"keyUrl": "[reference(resourceId('Microsoft.KeyVault/vaults/keys', parameters('kvName'), concat(resourceGroup().name, '-disk-encryption-key')), '2019-09-01', 'Full').properties.keyUriWithVersion]"
}
},
"name": "[concat(resourceGroup().name, '-disk-encryption-set')]",
"type": "Microsoft.Compute/diskEncryptionSets",
"location": "[resourceGroup().location]",
"condition": "[parameters('ci')]",
"apiVersion": "2020-12-01",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults/keys', parameters('kvName'), concat(resourceGroup().name, '-disk-encryption-key'))]"
]
},
{
"name": "[concat(parameters('kvName'), '/add')]",
"type": "Microsoft.KeyVault/vaults/accessPolicies",
"location": "[resourceGroup().location]",
"properties": {
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "[reference(resourceId('Microsoft.Compute/diskEncryptionSets', concat(resourceGroup().name, '-disk-encryption-set')), '2021-04-01', 'Full').identity.PrincipalId]",
"permissions": {
"keys": [
"get",
"wrapKey",
"unwrapKey"
]
}
}
]
},
"condition": "[parameters('ci')]",
"apiVersion": "2019-09-01",
"dependsOn": [
"[resourceId('Microsoft.Compute/diskEncryptionSets', concat(resourceGroup().name, '-disk-encryption-set'))]"
]
}
]
}