Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow dependsOn detection through 'existing' resource definitions #1991

Merged
merged 3 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
272 changes: 136 additions & 136 deletions docs/examples/101/aks-vmss-systemassigned-identity/main.json
Original file line number Diff line number Diff line change
@@ -1,137 +1,137 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsPrefix": {
"type": "string",
"defaultValue": "cl01",
"metadata": {
"description": "The DNS prefix to use with hosted Kubernetes API server FQDN."
}
},
"clusterName": {
"type": "string",
"defaultValue": "aks101",
"metadata": {
"description": "The name of the Managed Cluster resource."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Specifies the Azure location where the key vault should be created."
}
},
"agentCount": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The number of nodes for the cluster. 1 Node is enough for Dev/Test and minimum 3 nodes, is recommended for Production"
},
"maxValue": 50,
"minValue": 1
},
"agentVMSize": {
"type": "string",
"defaultValue": "Standard_D2_v3",
"metadata": {
"description": "The size of the Virtual Machine."
}
}
},
"functions": [],
"variables": {
"kubernetesVersion": "1.19.0",
"subnetRef": "[format('{0}/subnets/{1}', resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName')), variables('subnetName'))]",
"addressPrefix": "20.0.0.0/16",
"subnetName": "Subnet01",
"subnetPrefix": "20.0.0.0/24",
"virtualNetworkName": "MyVNET01",
"nodeResourceGroup": "[format('rg-{0}-{1}', parameters('dnsPrefix'), parameters('clusterName'))]",
"tags": {
"environment": "production",
"projectCode": "xyz"
},
"agentPoolName": "agentpool01"
},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-06-01",
"name": "[variables('virtualNetworkName')]",
"location": "[parameters('location')]",
"tags": "[variables('tags')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]"
}
}
]
}
},
{
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-09-01",
"name": "[parameters('clusterName')]",
"location": "[parameters('location')]",
"tags": "[variables('tags')]",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"kubernetesVersion": "[variables('kubernetesVersion')]",
"enableRBAC": true,
"dnsPrefix": "[parameters('dnsPrefix')]",
"agentPoolProfiles": [
{
"name": "[variables('agentPoolName')]",
"count": "[parameters('agentCount')]",
"mode": "System",
"vmSize": "[parameters('agentVMSize')]",
"type": "VirtualMachineScaleSets",
"osType": "Linux",
"enableAutoScaling": false,
"vnetSubnetID": "[variables('subnetRef')]"
}
],
"servicePrincipalProfile": {
"clientId": "msi"
},
"nodeResourceGroup": "[variables('nodeResourceGroup')]",
"networkProfile": {
"networkPlugin": "azure",
"loadBalancerSku": "standard"
}
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
]
}
],
"outputs": {
"id": {
"type": "string",
"value": "[resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))]"
},
"apiServerAddress": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))).fqdn]"
}
},
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "17474268025115212399"
}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsPrefix": {
"type": "string",
"defaultValue": "cl01",
"metadata": {
"description": "The DNS prefix to use with hosted Kubernetes API server FQDN."
}
},
"clusterName": {
"type": "string",
"defaultValue": "aks101",
"metadata": {
"description": "The name of the Managed Cluster resource."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Specifies the Azure location where the key vault should be created."
}
},
"agentCount": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The number of nodes for the cluster. 1 Node is enough for Dev/Test and minimum 3 nodes, is recommended for Production"
},
"maxValue": 50,
"minValue": 1
},
"agentVMSize": {
"type": "string",
"defaultValue": "Standard_D2_v3",
"metadata": {
"description": "The size of the Virtual Machine."
}
}
},
"functions": [],
"variables": {
"kubernetesVersion": "1.19.0",
"subnetRef": "[format('{0}/subnets/{1}', resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName')), variables('subnetName'))]",
"addressPrefix": "20.0.0.0/16",
"subnetName": "Subnet01",
"subnetPrefix": "20.0.0.0/24",
"virtualNetworkName": "MyVNET01",
"nodeResourceGroup": "[format('rg-{0}-{1}', parameters('dnsPrefix'), parameters('clusterName'))]",
"tags": {
"environment": "production",
"projectCode": "xyz"
},
"agentPoolName": "agentpool01"
},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-06-01",
"name": "[variables('virtualNetworkName')]",
"location": "[parameters('location')]",
"tags": "[variables('tags')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]"
}
}
]
}
},
{
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-09-01",
"name": "[parameters('clusterName')]",
"location": "[parameters('location')]",
"tags": "[variables('tags')]",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"kubernetesVersion": "[variables('kubernetesVersion')]",
"enableRBAC": true,
"dnsPrefix": "[parameters('dnsPrefix')]",
"agentPoolProfiles": [
{
"name": "[variables('agentPoolName')]",
"count": "[parameters('agentCount')]",
"mode": "System",
"vmSize": "[parameters('agentVMSize')]",
"type": "VirtualMachineScaleSets",
"osType": "Linux",
"enableAutoScaling": false,
"vnetSubnetID": "[variables('subnetRef')]"
}
],
"servicePrincipalProfile": {
"clientId": "msi"
},
"nodeResourceGroup": "[variables('nodeResourceGroup')]",
"networkProfile": {
"networkPlugin": "azure",
"loadBalancerSku": "standard"
}
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
]
}
],
"outputs": {
"id": {
"type": "string",
"value": "[resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))]"
},
"apiServerAddress": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))).fqdn]"
}
},
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "17474268025115212399"
}
}
}
5 changes: 2 additions & 3 deletions docs/examples/101/resource-with-lock-existing/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
"name": "DontDelete",
"properties": {
"level": "CanNotDelete"
},
"dependsOn": []
}
}
],
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "15375625835732419629"
"templateHash": "15116783846434100709"
}
}
}
Loading