iotsuite-cli
Version:
Command Line Interface for deploying pre-configured IoT solutions through Azure
467 lines • 18.9 kB
JSON
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"solutionName": {
"type": "string",
"metadata": {
"description": "The name of the solution"
}
},
"documentDBName": {
"type": "string",
"defaultValue": "[concat(take(uniqueString(subscription().subscriptionId, resourceGroup().id, parameters('solutionName')), 5), '-documentdb')]",
"metadata": {
"description": "The name of the documentDB"
}
},
"docDBConsistencyLevel": {
"type": "string",
"allowedValues": [
"Strong",
"BoundedStaleness",
"Session",
"ConsistentPrefix",
"Eventual"
],
"defaultValue": "Strong",
"metadata": {
"description": "The documentDB deault consistency level for this account."
}
},
"docDBMaxStalenessPrefix": {
"type": "int",
"minValue": 10,
"maxValue": 1000,
"defaultValue": 10,
"metadata": {
"description": "When documentDB consistencyLevel is set to BoundedStaleness, then this value is required, else it can be ignored."
}
},
"docDBMaxIntervalInSeconds": {
"type": "int",
"minValue": 5,
"maxValue": 600,
"defaultValue": 5,
"metadata": {
"description": "When documentDB consistencyLevel is set to BoundedStaleness, then this value is required, else it can be ignored."
}
},
"iotHubName": {
"type": "string",
"defaultValue": "[concat(take(uniqueString(subscription().subscriptionId, resourceGroup().id, parameters('solutionName')), 5), '-hub')]",
"metadata": {
"description": "The name of Azure IoT Hub"
}
},
"iotHubSku": {
"type": "string",
"defaultValue": "S2",
"metadata": {
"description": "The Azure IoT Hub SKU"
}
},
"iotHubTier": {
"type": "string",
"defaultValue": "Standard",
"metadata": {
"description": "The Azure IoT Hub tier"
}
},
"agentCount": {
"type": "int",
"defaultValue": 3,
"metadata": {
"description": "The number of agents for the cluster. This value can be from 1 to 100 (note, for Kubernetes clusters you will also get 1 or 2 public agents in addition to these seleted masters)"
},
"minValue": 1,
"maxValue": 100
},
"agentVMSize": {
"type": "string",
"defaultValue": "Standard_D2_v2",
"allowedValues": [
"Standard_A0",
"Standard_A1",
"Standard_A2",
"Standard_A3",
"Standard_A4",
"Standard_A5",
"Standard_A6",
"Standard_A7",
"Standard_A8",
"Standard_A9",
"Standard_A10",
"Standard_A11",
"Standard_D1",
"Standard_D2",
"Standard_D3",
"Standard_D4",
"Standard_D11",
"Standard_D12",
"Standard_D13",
"Standard_D14",
"Standard_D1_v2",
"Standard_D2_v2",
"Standard_D3_v2",
"Standard_D4_v2",
"Standard_D5_v2",
"Standard_D11_v2",
"Standard_D12_v2",
"Standard_D13_v2",
"Standard_D14_v2",
"Standard_G1",
"Standard_G2",
"Standard_G3",
"Standard_G4",
"Standard_G5",
"Standard_DS1",
"Standard_DS2",
"Standard_DS3",
"Standard_DS4",
"Standard_DS11",
"Standard_DS12",
"Standard_DS13",
"Standard_DS14",
"Standard_GS1",
"Standard_GS2",
"Standard_GS3",
"Standard_GS4",
"Standard_GS5"
],
"metadata": {
"description": "The size of the Virtual Machine."
}
},
"adminUsername": {
"type": "string",
"defaultValue": "azureuser",
"metadata": {
"description": "User name for the Linux Virtual Machines."
}
},
"masterCount": {
"type": "int",
"defaultValue": 1,
"allowedValues": [
1
],
"metadata": {
"description": "The number of Kubernetes masters for the cluster."
}
},
"sshRSAPublicKey": {
"type": "string",
"metadata": {
"description": "Configure all linux machines with the SSH RSA public key string. Your key should include three parts, for example 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm'"
}
},
"servicePrincipalClientId": {
"metadata": {
"description": "Client ID (used by cloudprovider)"
},
"type": "securestring",
"defaultValue": "n/a"
},
"servicePrincipalSecret": {
"metadata": {
"description": "The Service Principal Client Secret."
},
"type": "securestring",
"defaultValue": "n/a"
},
"azureWebsiteName": {
"type": "string",
"metadata": {
"description": "The name of the azure website that you want to create. It will be of format {azureWebsiteName}.azurewebsites.net"
}
},
"remoteEndpointSSLThumbprint": {
"type": "securestring",
"metadata": {
"description": "This is the thumbprint of the HTTPS SSL Certificate"
},
"defaultValue": "secretkey"
},
"storageName": {
"type": "string",
"defaultValue": "[concat(take(uniqueString(subscription().subscriptionId, resourceGroup().id, parameters('solutionName')), 5), 'storage')]",
"metadata": {
"description": "The name of the storageAccount"
}
},
"storageSkuName": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS",
"Standard_ZRS",
"Premium_LRS"
],
"metadata": {
"description": "The storage SKU name"
}
}
},
"variables": {
"location": "[resourceGroup().location]",
"docDBVersion": "2015-04-08",
"docDBResourceId": "[resourceId('Microsoft.DocumentDb/databaseAccounts', parameters('documentDBName'))]",
"iotHubVersion": "2016-02-03",
"iotHubResourceId": "[resourceId('Microsoft.Devices/Iothubs', parameters('iotHubName'))]",
"iotHubKeyName": "iothubowner",
"iotHubKeyResource": "[resourceId('Microsoft.Devices/Iothubs/Iothubkeys', parameters('iotHubName'), variables('iotHubKeyName'))]",
"solutionType": "RemoteMonitoring",
"adminUsername": "[parameters('adminUsername')]",
"agentCount": "[parameters('agentCount')]",
"publicIPName": "[concat(take(uniqueString(subscription().subscriptionId, resourceGroup().id, parameters('solutionName')), 5), '-public-ip')]",
"clusterName": "[concat(resourceGroup().name, '-cluster')]",
"agentsEndpointDNSNamePrefix": "[concat(parameters('solutionName'),'-agents')]",
"domainNameLabel": "[concat('agent-', take(uniqueString(subscription().subscriptionId, resourceGroup().id, parameters('solutionName')), 5))]",
"agentVMSize": "[parameters('agentVMSize')]",
"masterCount": "[parameters('masterCount')]",
"mastersEndpointDNSNamePrefix": "[concat(parameters('solutionName'),'-mgmt')]",
"orchestratorType": "Kubernetes",
"sshRSAPublicKey": "[parameters('sshRSAPublicKey')]",
"servicePrincipalClientId": "[parameters('servicePrincipalClientId')]",
"servicePrincipalClientSecret": "[parameters('servicePrincipalSecret')]",
"useServicePrincipalDictionary": {
"DCOS": 0,
"Swarm": 0,
"Kubernetes": 1
},
"useServicePrincipal": "[variables('useServicePrincipalDictionary')[variables('orchestratorType')]]",
"servicePrincipalFields": [
null,
{
"ClientId": "[parameters('servicePrincipalClientId')]",
"Secret": "[parameters('servicePrincipalSecret')]"
}
],
"sku": "S1",
"workerSize": "0",
"repoURL": "https://github.com/Azure/reverse-proxy-dotnet.git",
"branch": "master",
"hostingPlanName": "[parameters('azureWebsiteName')]",
"storageResourceId": "[resourceId('Microsoft.Storage/storageAccounts/', parameters('storageName'))]",
"storageApiVersion": "2017-06-01"
},
"resources": [
{
"type": "Microsoft.Network/publicIPAddresses",
"name": "[variables('publicIPName')]",
"apiVersion": "2016-11-01",
"location": "[resourceGroup().location]",
"properties": {
"publicIPAllocationMethod": "Static",
"idleTimeoutInMinutes": 4,
"dnsSettings": {
"domainNameLabel": "[toLower(variables('domainNameLabel'))]"
}
}
},
{
"type": "Microsoft.Web/serverfarms",
"sku": {
"name": "[variables('sku')]",
"capacity": "[variables('workerSize')]"
},
"name": "[variables('hostingPlanName')]",
"apiVersion": "2015-08-01",
"location": "[resourceGroup().location]",
"properties": {
"name": "[variables('hostingPlanName')]"
}
},
{
"type": "Microsoft.Web/sites",
"name": "[parameters('azureWebsiteName')]",
"apiVersion": "2015-08-01",
"location": "[resourceGroup().location]",
"properties": {
"serverFarmId": "[variables('hostingPlanName')]",
"siteConfig": {
"appSettings": [
{
"name": "REMOTE_ENDPOINT",
"value": "[concat('https://', reference(variables('publicIPName')).dnsSettings.fqdn)]"
},
{
"name": "REMOTE_ENDPOINT_SSL_THUMBPRINT",
"value": "[parameters('remoteEndpointSSLThumbprint')]"
}
]
}
},
"resources": [
{
"type": "sourcecontrols",
"name": "web",
"apiVersion": "2015-08-01",
"properties": {
"RepoUrl": "[variables('repoURL')]",
"branch": "[variables('branch')]",
"IsManualIntegration": true
},
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('azureWebsiteName'))]"
]
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPName'))]"
]
},
{
"apiVersion": "[variables('docDBVersion')]",
"type": "Microsoft.DocumentDb/databaseAccounts",
"name": "[parameters('documentDBName')]",
"location": "[variables('location')]",
"tags": {
"IotSolutionType": "[variables('solutionType')]"
},
"properties": {
"name": "[parameters('documentDBName')]",
"databaseAccountOfferType": "standard",
"consistencyPolicy": {
"defaultConsistencyLevel": "[parameters('docDBConsistencyLevel')]",
"maxStalenessPrefix": "[parameters('docDBMaxStalenessPrefix')]",
"maxIntervalInSeconds": "[parameters('docDBMaxIntervalInSeconds')]"
}
}
},
{
"apiVersion": "[variables('iotHubVersion')]",
"type": "Microsoft.Devices/Iothubs",
"name": "[parameters('iotHubName')]",
"location": "[variables('location')]",
"sku": {
"name": "[parameters('iotHubSku')]",
"tier": "[parameters('iotHubTier')]",
"capacity": 1
},
"tags": {
"IotSolutionType": "[variables('solutionType')]"
},
"properties": {
"location": "[variables('location')]"
}
},
{
"apiVersion": "2016-09-30",
"type": "Microsoft.ContainerService/containerServices",
"location": "[resourceGroup().location]",
"name": "[variables('clusterName')]",
"properties": {
"orchestratorProfile": {
"orchestratorType": "[variables('orchestratorType')]"
},
"masterProfile": {
"count": "[variables('masterCount')]",
"dnsPrefix": "[variables('mastersEndpointDNSNamePrefix')]"
},
"agentPoolProfiles": [
{
"name": "agentpools",
"count": "[variables('agentCount')]",
"vmSize": "[variables('agentVMSize')]",
"dnsPrefix": "[variables('agentsEndpointDNSNamePrefix')]"
}
],
"linuxProfile": {
"adminUsername": "[variables('adminUsername')]",
"ssh": {
"publicKeys": [
{
"keyData": "[variables('sshRSAPublicKey')]"
}
]
}
},
"servicePrincipalProfile": "[variables('servicePrincipalFields')[variables('useServicePrincipal')]]"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[parameters('storageName')]",
"apiVersion": "[variables('storageApiVersion')]",
"location": "[variables('location')]",
"tags": {
"IotSuiteType": "[variables('solutionType')]"
},
"kind": "Storage",
"sku": {
"name": "[parameters('storageSkuName')]"
}
}
],
"outputs": {
"resourceGroup": {
"type": "string",
"value": "[resourceGroup().name]"
},
"iotHubHostName": {
"type": "string",
"value": "[parameters('iotHubName')]"
},
"iotHubConnectionString": {
"type": "string",
"value": "[concat('HostName=', reference(variables('iotHubResourceId')).hostName, ';SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listkeys(variables('iotHubKeyResource'), variables('iotHubVersion')).primaryKey)]"
},
"documentDBConnectionString": {
"type": "string",
"value": "[concat('AccountEndpoint=', reference(variables('docDBResourceId')).documentEndpoint, ';AccountKey=', listkeys(variables('docDBResourceId'), '2015-04-08').primaryMasterKey, ';')]"
},
"containerServiceName": {
"type": "string",
"value": "[variables('clusterName')]"
},
"masterFQDN": {
"type": "string",
"value": "[reference(concat('Microsoft.ContainerService/containerServices/', variables('clusterName'))).masterProfile.fqdn]"
},
"adminUsername": {
"type": "string",
"value": "[variables('adminUsername')]"
},
"sshMaster0": {
"type": "string",
"value": "[concat('ssh ', variables('adminUsername'), '@', reference(concat('Microsoft.ContainerService/containerServices/', variables('clusterName'))).masterProfile.fqdn, ' -A -p 22')]"
},
"loadBalancerIp": {
"type": "string",
"value": "[reference(variables('publicIPName')).ipAddress]"
},
"agentFQDN": {
"type": "string",
"value": "[reference(variables('publicIPName')).dnsSettings.fqdn]"
},
"azureWebsite": {
"type": "string",
"value": "[concat('https://', parameters('azureWebsiteName'), '.azurewebsites.net')]"
},
"eventHubPartitions": {
"type": "int",
"value": "[reference(variables('iotHubResourceId')).eventHubEndpoints.events.partitionCount]"
},
"eventHubName": {
"type": "string",
"value": "[parameters('iotHubName')]"
},
"eventHubEndpoint": {
"type": "string",
"value": "[reference(variables('iotHubResourceId')).eventHubEndpoints.events.endpoint]"
},
"storageAccountName": {
"type": "string",
"value": "[parameters('storageName')]"
},
"storageAccountKey": {
"type": "string",
"value": "[listKeys(variables('storageResourceId'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]"
}
}
}