github.phpd.cn/hashicorp/packer@v1.3.2/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment06.approved.json (about)

     1  {
     2    "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
     3    "contentVersion": "1.0.0.0",
     4    "parameters": {
     5      "adminPassword": {
     6        "type": "string"
     7      },
     8      "adminUsername": {
     9        "type": "string"
    10      },
    11      "dnsNameForPublicIP": {
    12        "type": "string"
    13      },
    14      "nicName": {
    15        "type": "string"
    16      },
    17      "osDiskName": {
    18        "type": "string"
    19      },
    20      "publicIPAddressName": {
    21        "type": "string"
    22      },
    23      "storageAccountBlobEndpoint": {
    24        "type": "string"
    25      },
    26      "subnetName": {
    27        "type": "string"
    28      },
    29      "virtualNetworkName": {
    30        "type": "string"
    31      },
    32      "vmName": {
    33        "type": "string"
    34      },
    35      "vmSize": {
    36        "type": "string"
    37      }
    38    },
    39    "resources": [
    40      {
    41        "apiVersion": "[variables('publicIPAddressApiVersion')]",
    42        "location": "[variables('location')]",
    43        "name": "[parameters('publicIPAddressName')]",
    44        "properties": {
    45          "dnsSettings": {
    46            "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
    47          },
    48          "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
    49        },
    50        "tags": {
    51          "tag01": "value01",
    52          "tag02": "value02",
    53          "tag03": "value03"
    54        },
    55        "type": "Microsoft.Network/publicIPAddresses"
    56      },
    57      {
    58        "apiVersion": "[variables('virtualNetworksApiVersion')]",
    59        "location": "[variables('location')]",
    60        "name": "[variables('virtualNetworkName')]",
    61        "properties": {
    62          "addressSpace": {
    63            "addressPrefixes": [
    64              "[variables('addressPrefix')]"
    65            ]
    66          },
    67          "subnets": [
    68            {
    69              "name": "[variables('subnetName')]",
    70              "properties": {
    71                "addressPrefix": "[variables('subnetAddressPrefix')]"
    72              }
    73            }
    74          ]
    75        },
    76        "tags": {
    77          "tag01": "value01",
    78          "tag02": "value02",
    79          "tag03": "value03"
    80        },
    81        "type": "Microsoft.Network/virtualNetworks"
    82      },
    83      {
    84        "apiVersion": "[variables('networkInterfacesApiVersion')]",
    85        "dependsOn": [
    86          "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
    87          "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
    88        ],
    89        "location": "[variables('location')]",
    90        "name": "[parameters('nicName')]",
    91        "properties": {
    92          "ipConfigurations": [
    93            {
    94              "name": "ipconfig",
    95              "properties": {
    96                "privateIPAllocationMethod": "Dynamic",
    97                "publicIPAddress": {
    98                  "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
    99                },
   100                "subnet": {
   101                  "id": "[variables('subnetRef')]"
   102                }
   103              }
   104            }
   105          ]
   106        },
   107        "tags": {
   108          "tag01": "value01",
   109          "tag02": "value02",
   110          "tag03": "value03"
   111        },
   112        "type": "Microsoft.Network/networkInterfaces"
   113      },
   114      {
   115        "apiVersion": "[variables('apiVersion')]",
   116        "dependsOn": [
   117          "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
   118        ],
   119        "location": "[variables('location')]",
   120        "name": "[parameters('vmName')]",
   121        "properties": {
   122          "diagnosticsProfile": {
   123            "bootDiagnostics": {
   124              "enabled": false
   125            }
   126          },
   127          "hardwareProfile": {
   128            "vmSize": "[parameters('vmSize')]"
   129          },
   130          "networkProfile": {
   131            "networkInterfaces": [
   132              {
   133                "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
   134              }
   135            ]
   136          },
   137          "osProfile": {
   138            "adminPassword": "[parameters('adminPassword')]",
   139            "adminUsername": "[parameters('adminUsername')]",
   140            "computerName": "[parameters('vmName')]",
   141            "linuxConfiguration": {
   142              "ssh": {
   143                "publicKeys": [
   144                  {
   145                    "keyData": "",
   146                    "path": "[variables('sshKeyPath')]"
   147                  }
   148                ]
   149              }
   150            }
   151          },
   152          "storageProfile": {
   153            "osDisk": {
   154              "caching": "ReadWrite",
   155              "createOption": "FromImage",
   156              "image": {
   157                "uri": "https://localhost/custom.vhd"
   158              },
   159              "name": "[parameters('osDiskName')]",
   160              "osType": "Linux",
   161              "vhd": {
   162                "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
   163              }
   164            }
   165          }
   166        },
   167        "tags": {
   168          "tag01": "value01",
   169          "tag02": "value02",
   170          "tag03": "value03"
   171        },
   172        "type": "Microsoft.Compute/virtualMachines"
   173      }
   174    ],
   175    "variables": {
   176      "addressPrefix": "10.0.0.0/16",
   177      "apiVersion": "2017-03-30",
   178      "location": "[resourceGroup().location]",
   179      "managedDiskApiVersion": "2017-03-30",
   180      "networkInterfacesApiVersion": "2017-04-01",
   181      "publicIPAddressApiVersion": "2017-04-01",
   182      "publicIPAddressType": "Dynamic",
   183      "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
   184      "subnetAddressPrefix": "10.0.0.0/24",
   185      "subnetName": "[parameters('subnetName')]",
   186      "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
   187      "virtualNetworkName": "[parameters('virtualNetworkName')]",
   188      "virtualNetworkResourceGroup": "[resourceGroup().name]",
   189      "virtualNetworksApiVersion": "2017-04-01",
   190      "vmStorageAccountContainerName": "images",
   191      "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
   192    }
   193  }