Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Adding a private template that doesn't create a public IP
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitarella Matthew (0614712) authored and Vitarella Matthew (0614712) committed Sep 28, 2021
1 parent bc89b4c commit a186778
Showing 1 changed file with 212 additions and 0 deletions.
212 changes: 212 additions & 0 deletions src/machines/kibana-resources-private.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"metadata": {
"description": "Location where resources will be provisioned"
}
},
"namespace": {
"type": "string",
"metadata": {
"description": "The unique namespace for the Kibana VM"
}
},
"networkSettings": {
"type": "object",
"metadata": {
"description": "Network settings"
}
},
"credentials": {
"type": "secureObject",
"metadata": {
"description": "Credentials information block"
}
},
"osSettings": {
"type": "object",
"metadata": {
"description": "Platform and OS settings"
}
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_A1",
"metadata": {
"description": "Size of the Kibana VM"
}
},
"acceleratedNetworking": {
"type": "string",
"defaultValue": "No",
"allowedValues": [
"Yes",
"No"
],
"metadata": {
"description": "Whether to enable accelerated networking for Kibana, which enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. Valid only for specific VM SKUs"
}
},
"elasticTags": {
"type": "object",
"defaultValue": {
"provider": "648D2193-0CE0-4EFB-8A82-AF9792184FD9"
},
"metadata": {
"description": "Unique identifiers to allow the Azure Infrastructure to understand the origin of resources deployed to Azure. You do not need to supply a value for this."
}
}
},
"variables": {
"namespace": "[parameters('namespace')]",
"subnetId": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]",
"securityGroupName": "[concat(variables('namespace'), '-nsg')]",
"nicName": "[concat(variables('namespace'), '-nic')]",
"password_osProfile": {
"computername": "[parameters('namespace')]",
"adminUsername": "[parameters('credentials').adminUsername]",
"adminPassword": "[parameters('credentials').password]"
},
"sshPublicKey_osProfile": {
"computername": "[parameters('namespace')]",
"adminUsername": "[parameters('credentials').adminUsername]",
"linuxConfiguration": {
"disablePasswordAuthentication": "true",
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', parameters('credentials').adminUsername, '/.ssh/authorized_keys')]",
"keyData": "[parameters('credentials').sshPublicKey]"
}
]
}
}
},
"osProfile": "[variables(concat(parameters('credentials').authenticationType, '_osProfile'))]"
},
"resources": [
{
"apiVersion": "2019-04-01",
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[variables('securityGroupName')]",
"location": "[parameters('location')]",
"tags": {
"provider": "[toUpper(parameters('elasticTags').provider)]"
},
"properties": {
"securityRules": [
{
"name": "SSH",
"properties": {
"description": "Allows inbound SSH traffic from anyone",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "[parameters('osSettings').managementPort]",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 100,
"direction": "Inbound"
}
},
{
"name": "Kibana",
"properties": {
"description": "Allows inbound Kibana traffic from anyone",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "5601",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 200,
"direction": "Inbound"
}
}
]
}
},
{
"apiVersion": "2019-04-01",
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"location": "[parameters('location')]",
"tags": {
"provider": "[toUpper(parameters('elasticTags').provider)]"
},
"dependsOn": [
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('securityGroupName'))]"
],
"properties": {
"primary": true,
"enableAcceleratedNetworking": "[equals(parameters('acceleratedNetworking'), 'Yes')]",
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('subnetId')]"
}
}
}
],
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('securityGroupName'))]"
}
}
},
{
"apiVersion": "2019-03-01",
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('namespace')]",
"location": "[parameters('location')]",
"tags": {
"provider": "[toUpper(parameters('elasticTags').provider)]"
},
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": "[variables('osProfile')]",
"storageProfile": {
"imageReference": "[parameters('osSettings').imageReference]",
"osDisk": {
"name": "[concat(variables('namespace'), '-osdisk')]",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
}
]
}
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('namespace'), '/script')]",
"apiVersion": "2019-03-01",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', parameters('namespace'))]"
],
"properties": "[parameters('osSettings').extensionSettings.kibana]"
}
]
}
],
"outputs": {}
}

0 comments on commit a186778

Please sign in to comment.