fortinetsolutions / Azure-Templates

Azure Templates for Fortinet Solutions
https://www.fortinet.com/azure
61 stars 63 forks source link

dependsOn - Nics and Public IPs #17

Open sergiopenteado opened 5 years ago

sergiopenteado commented 5 years ago

Please update as follows:

    {
        "condition": "[equals(parameters('publicIPNewOrExisting'), 'new')]",
        "type": "Microsoft.Network/publicIPAddresses",
        "apiVersion": "2017-09-01",
        "tags": {
            "provider": "[toUpper(parameters('FortinetTags').provider)]"
        },
        "name": "[parameters('publicIPAddressName')]",
        "location": "[parameters('location')]",
        "dependsOn": [
            "[variables('network_NIC_fg11_Name')]"
        ],
        "sku": {
            "name": "Standard"
        },
        "properties": {
            "publicIPAllocationMethod": "[parameters('publicIPAddressType')]"
        }
    },
    {
        "condition": "[equals(parameters('publicIP2NewOrExisting'), 'new')]",
        "type": "Microsoft.Network/publicIPAddresses",
        "apiVersion": "2017-09-01",
        "tags": {
            "provider": "[toUpper(parameters('FortinetTags').provider)]"
        },
        "name": "[parameters('publicIPAddress2Name')]",
        "location": "[parameters('location')]",
        "dependsOn": [
            "[variables('network_NIC_fg14_Name')]"
        ],
        "sku": {
            "name": "Standard"
        },
        "properties": {
            "publicIPAllocationMethod": "[parameters('publicIPAddressType')]"
        }
    },
    {
        "condition": "[equals(parameters('publicIP3NewOrExisting'), 'new')]",
        "type": "Microsoft.Network/publicIPAddresses",
        "apiVersion": "2017-09-01",
        "tags": {
            "provider": "[toUpper(parameters('FortinetTags').provider)]"
        },
        "name": "[parameters('publicIPAddress3Name')]",
        "location": "[parameters('location')]",
        "dependsOn": [
            "[variables('network_NIC_fg24_Name')]"
        ],
        "sku": {
            "name": "Standard"
        },
        "properties": {
            "publicIPAllocationMethod": "[parameters('publicIPAddressType')]"
        }
    },

############################################## { "type": "Microsoft.Resources/deployments", "name": "UpdateNIC11", "apiVersion": "2015-01-01", "dependsOn": [ "[variables('network_NIC_fg11_Name')]", "[variables('publicIPID')]" ], "properties": { "mode": "Incremental", "templateLink": { "uri": "[variables('updateIPURI')]", "contentVersion": "1.0.0.0" }, "parameters": { "nicName": { "value": "[variables('network_NIC_fg11_Name')]" }, "SubnetRef": { "value": "[variables('subnet1Ref')]" }, "privateIp": { "value": "[reference(concat('Microsoft.Network/networkInterfaces/', variables('network_NIC_fg11_Name'))).ipConfigurations[0].properties.privateIPAddress]" }, "publicIp": { "value": "[variables('publicIPID')]" }, "FortinetTags": { "value": "[parameters('FortinetTags')]" }, "NSGName": { "value": "[variables('NSGName')]" } } } }, { "type": "Microsoft.Resources/deployments", "name": "UpdateNIC14", "apiVersion": "2015-01-01", "dependsOn": [ "[variables('network_NIC_fg14_Name')]", "[variables('publicIP2ID')]" ], "properties": { "mode": "Incremental", "templateLink": { "uri": "[variables('updateIPURI')]", "contentVersion": "1.0.0.0" }, "parameters": { "nicName": { "value": "[variables('network_NIC_fg14_Name')]" }, "SubnetRef": { "value": "[variables('subnet4Ref')]" }, "privateIp": { "value": "[reference(concat('Microsoft.Network/networkInterfaces/', variables('network_NIC_fg14_Name'))).ipConfigurations[0].properties.privateIPAddress]" }, "publicIp": { "value": "[variables('publicIP2ID')]" }, "FortinetTags": { "value": "[parameters('FortinetTags')]" }, "NSGName": { "value": "[variables('NSGName')]" } } } }, { "type": "Microsoft.Resources/deployments", "name": "UpdateNIC24", "apiVersion": "2015-01-01", "dependsOn": [ "[variables('network_NIC_fg24_Name')]", "[variables('publicIP3ID')]" ], "properties": { "mode": "Incremental", "templateLink": { "uri": "[variables('updateIPURI')]", "contentVersion": "1.0.0.0" }, "parameters": { "nicName": { "value": "[variables('network_NIC_fg24_Name')]" }, "SubnetRef": { "value": "[variables('subnet4Ref')]" }, "privateIp": { "value": "[reference(concat('Microsoft.Network/networkInterfaces/', variables('network_NIC_fg24_Name'))).ipConfigurations[0].properties.privateIPAddress]" }, "publicIp": { "value": "[variables('publicIP3ID')]" }, "FortinetTags": { "value": "[parameters('FortinetTags')]" }, "NSGName": { "value": "[variables('NSGName')]" } } } },

###################################################

After this update the resource group of the public IP's will be required, no matter if they are new or existing.

Thanks, -SP