|
70 | 70 | }, |
71 | 71 | "streams": { |
72 | 72 | "type": "array" |
| 73 | + }, |
| 74 | + "useAzureMonitorPrivateLinkScope": { |
| 75 | + "type": "bool" |
| 76 | + }, |
| 77 | + "azureMonitorPrivateLinkScopeResourceId": { |
| 78 | + "type": "string" |
73 | 79 | } |
74 | 80 | }, |
75 | 81 | "variables": { |
76 | 82 | "clusterSubscriptionId": "[split(parameters('aksResourceId'),'/')[2]]", |
77 | 83 | "clusterResourceGroup": "[split(parameters('aksResourceId'),'/')[4]]", |
78 | 84 | "clusterName": "[split(parameters('aksResourceId'),'/')[8]]", |
79 | 85 | "clusterLocation": "[replace(parameters('aksResourceLocation'),' ', '')]", |
| 86 | + "workspaceName": "[split(parameters('workspaceResourceId'),'/')[8]]", |
80 | 87 | "workspaceLocation":"[replace(parameters('workspaceRegion'),' ', '')]", |
81 | 88 | "dcrNameFull": "[Concat('MSCI', '-', variables('workspaceLocation'), '-', variables('clusterName'))]", |
82 | 89 | "dcrName":"[if(greater(length(variables('dcrNameFull')), 64), substring(variables('dcrNameFull'), 0, 64), variables('dcrNameFull'))]", |
|
87 | 94 | "ingestionDCEName": "[if(greater(length(variables('ingestionDCENameFull')), 43), substring(variables('ingestionDCENameFull'), 0, 43), variables('ingestionDCENameFull'))]", |
88 | 95 | "ingestionDCE": "[if(endsWith(variables('ingestionDCEName'), '-'), substring(variables('ingestionDCEName'), 0, 42), variables('ingestionDCEName'))]", |
89 | 96 | "ingestionDataCollectionEndpointId": "[resourceId(variables('clusterSubscriptionId'), variables('clusterResourceGroup'), 'Microsoft.Insights/dataCollectionEndpoints', variables('ingestionDCE'))]", |
| 97 | + "configDCENameFull": "[Concat('MSCI-config', '-', variables('clusterLocation'), '-', variables('clusterName'))]", |
| 98 | + "configDCEName": "[if(greater(length(variables('configDCENameFull')), 43), substring(variables('configDCENameFull'), 0, 43), variables('configDCENameFull'))]", |
| 99 | + "configDCE": "[if(endsWith(variables('configDCEName'), '-'), substring(variables('configDCEName'), 0, 42), variables('configDCEName'))]", |
| 100 | + "configDCEAssociationName": "configurationAccessEndpoint", |
| 101 | + "configDataCollectionEndpointId": "[resourceId(variables('clusterSubscriptionId'), variables('clusterResourceGroup'), 'Microsoft.Insights/dataCollectionEndpoints', variables('configDCE'))]", |
| 102 | + "privateLinkScopeName": "[split(parameters('azureMonitorPrivateLinkScopeResourceId'),'/')[8]]", |
| 103 | + "privateLinkScopeResourceGroup": "[split(parameters('azureMonitorPrivateLinkScopeResourceId'),'/')[4]]", |
| 104 | + "privateLinkScopeSubscriptionId": "[split(parameters('azureMonitorPrivateLinkScopeResourceId'),'/')[2]]", |
90 | 105 | "ciOnlyTemplate": { |
91 | 106 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
92 | 107 | "contentVersion": "1.0.0.0", |
|
211 | 226 | } |
212 | 227 | }, |
213 | 228 | "resources": [ |
| 229 | + { |
| 230 | + "condition": "[parameters('useAzureMonitorPrivateLinkScope')]", |
| 231 | + "type": "Microsoft.Insights/dataCollectionEndpoints", |
| 232 | + "apiVersion": "2022-06-01", |
| 233 | + "name": "[variables('configDCE')]", |
| 234 | + "location": "[variables('clusterLocation')]", |
| 235 | + "tags": "[parameters('resourceTagValues')]", |
| 236 | + "kind": "Linux", |
| 237 | + "properties": { |
| 238 | + "networkAcls": { |
| 239 | + "publicNetworkAccess": "[if(parameters('useAzureMonitorPrivateLinkScope'), 'Disabled', 'Enabled')]" |
| 240 | + } |
| 241 | + } |
| 242 | + }, |
214 | 243 | { |
215 | 244 | "condition": "[variables('enableHighLogScaleMode')]", |
216 | 245 | "type": "Microsoft.Insights/dataCollectionEndpoints", |
|
221 | 250 | "kind": "Linux", |
222 | 251 | "properties": { |
223 | 252 | "networkAcls": { |
224 | | - "publicNetworkAccess": "Enabled" |
| 253 | + "publicNetworkAccess": "[if(parameters('useAzureMonitorPrivateLinkScope'), 'Disabled', 'Enabled')]" |
225 | 254 | } |
226 | 255 | } |
227 | 256 | }, |
|
269 | 298 | "parameters": {} |
270 | 299 | } |
271 | 300 | }, |
| 301 | + { |
| 302 | + "condition": "[parameters('useAzureMonitorPrivateLinkScope')]", |
| 303 | + "type": "Microsoft.Resources/deployments", |
| 304 | + "name": "[Concat('aks-monitoring-msi-dcea-config', '-', uniqueString(parameters('aksResourceId')))]", |
| 305 | + "apiVersion": "2017-05-10", |
| 306 | + "subscriptionId": "[variables('clusterSubscriptionId')]", |
| 307 | + "resourceGroup": "[variables('clusterResourceGroup')]", |
| 308 | + "dependsOn": [ |
| 309 | + "[resourceId('Microsoft.Insights/dataCollectionEndpoints/', variables('configDCE'))]" |
| 310 | + ], |
| 311 | + "properties": { |
| 312 | + "mode": "Incremental", |
| 313 | + "template": { |
| 314 | + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
| 315 | + "contentVersion": "1.0.0.0", |
| 316 | + "parameters": {}, |
| 317 | + "variables": {}, |
| 318 | + "resources": [ |
| 319 | + { |
| 320 | + "type": "Microsoft.ContainerService/managedClusters/providers/dataCollectionRuleAssociations", |
| 321 | + "name": "[concat(variables('clusterName'),'/microsoft.insights/', variables('configDCEAssociationName'))]", |
| 322 | + "apiVersion": "2022-06-01", |
| 323 | + "properties": { |
| 324 | + "description": "Association of data collection rule endpoint. Deleting this association will break the data collection endpoint for this AKS Cluster.", |
| 325 | + "dataCollectionEndpointId": "[variables('configDataCollectionEndpointId')]" |
| 326 | + } |
| 327 | + } |
| 328 | + ] |
| 329 | + }, |
| 330 | + "parameters": {} |
| 331 | + } |
| 332 | + }, |
| 333 | + { |
| 334 | + "condition": "[parameters('useAzureMonitorPrivateLinkScope')]", |
| 335 | + "type": "Microsoft.Resources/deployments", |
| 336 | + "name": "[Concat('aks-monitoring-msi-ampls-scope-config', '-', uniqueString(parameters('aksResourceId')))]", |
| 337 | + "apiVersion": "2017-05-10", |
| 338 | + "subscriptionId": "[variables('privateLinkScopeSubscriptionId')]", |
| 339 | + "resourceGroup": "[variables('privateLinkScopeResourceGroup')]", |
| 340 | + "dependsOn": [ |
| 341 | + "[resourceId('Microsoft.Insights/dataCollectionEndpoints/', variables('configDCE'))]" |
| 342 | + ], |
| 343 | + "properties": { |
| 344 | + "mode": "Incremental", |
| 345 | + "template": { |
| 346 | + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
| 347 | + "contentVersion": "1.0.0.0", |
| 348 | + "parameters": {}, |
| 349 | + "variables": {}, |
| 350 | + "resources": [ |
| 351 | + { |
| 352 | + "type": "microsoft.insights/privatelinkscopes/scopedresources", |
| 353 | + "name": "[concat(variables('privateLinkScopeName'), '/', concat(variables('configDCE'), '-connection'))]", |
| 354 | + "apiVersion": "2021-07-01-preview", |
| 355 | + "properties": { |
| 356 | + "linkedResourceId": "[variables('configDataCollectionEndpointId')]" |
| 357 | + } |
| 358 | + } |
| 359 | + ] |
| 360 | + }, |
| 361 | + "parameters": {} |
| 362 | + } |
| 363 | + }, |
| 364 | + { |
| 365 | + "condition": "[and(parameters('useAzureMonitorPrivateLinkScope'), variables('enableHighLogScaleMode'))]", |
| 366 | + "type": "Microsoft.Resources/deployments", |
| 367 | + "name": "[Concat('aks-monitoring-msi-ampls-scope-ingest', '-', uniqueString(parameters('aksResourceId')))]", |
| 368 | + "apiVersion": "2017-05-10", |
| 369 | + "subscriptionId": "[variables('privateLinkScopeSubscriptionId')]", |
| 370 | + "resourceGroup": "[variables('privateLinkScopeResourceGroup')]", |
| 371 | + "dependsOn": [ |
| 372 | + "[resourceId('Microsoft.Insights/dataCollectionEndpoints/', variables('ingestionDCE'))]" |
| 373 | + ], |
| 374 | + "properties": { |
| 375 | + "mode": "Incremental", |
| 376 | + "template": { |
| 377 | + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
| 378 | + "contentVersion": "1.0.0.0", |
| 379 | + "parameters": {}, |
| 380 | + "variables": {}, |
| 381 | + "resources": [ |
| 382 | + { |
| 383 | + "type": "microsoft.insights/privatelinkscopes/scopedresources", |
| 384 | + "name": "[concat(variables('privateLinkScopeName'), '/', concat(variables('ingestionDCE'), '-connection'))]", |
| 385 | + "apiVersion": "2021-07-01-preview", |
| 386 | + "properties": { |
| 387 | + "linkedResourceId": "[variables('ingestionDataCollectionEndpointId')]" |
| 388 | + } |
| 389 | + } |
| 390 | + ] |
| 391 | + }, |
| 392 | + "parameters": {} |
| 393 | + } |
| 394 | + }, |
| 395 | + { |
| 396 | + "condition": "[parameters('useAzureMonitorPrivateLinkScope')]", |
| 397 | + "type": "Microsoft.Resources/deployments", |
| 398 | + "name": "[Concat('aks-monitoring-msi-ampls-scope', '-', uniqueString(parameters('workspaceResourceId')))]", |
| 399 | + "apiVersion": "2017-05-10", |
| 400 | + "subscriptionId": "[variables('privateLinkScopeSubscriptionId')]", |
| 401 | + "resourceGroup": "[variables('privateLinkScopeResourceGroup')]", |
| 402 | + "properties": { |
| 403 | + "mode": "Incremental", |
| 404 | + "template": { |
| 405 | + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
| 406 | + "contentVersion": "1.0.0.0", |
| 407 | + "parameters": {}, |
| 408 | + "variables": {}, |
| 409 | + "resources": [ |
| 410 | + { |
| 411 | + "type": "microsoft.insights/privatelinkscopes/scopedresources", |
| 412 | + "name": "[concat(variables('privateLinkScopeName'), '/', concat(variables('workspaceName'), '-connection'))]", |
| 413 | + "apiVersion": "2021-07-01-preview", |
| 414 | + "properties": { |
| 415 | + "linkedResourceId": "[parameters('workspaceResourceId')]" |
| 416 | + } |
| 417 | + } |
| 418 | + ] |
| 419 | + }, |
| 420 | + "parameters": {} |
| 421 | + } |
| 422 | + }, |
272 | 423 | { |
273 | 424 | "type": "Microsoft.Resources/deployments", |
274 | 425 | "name": "[Concat('aks-monitoring-msi-addon', '-', uniqueString(parameters('aksResourceId')))]", |
275 | 426 | "apiVersion": "2017-05-10", |
276 | 427 | "subscriptionId": "[variables('clusterSubscriptionId')]", |
277 | 428 | "resourceGroup": "[variables('clusterResourceGroup')]", |
278 | 429 | "dependsOn": [ |
279 | | - "[Concat('aks-monitoring-msi-dcra', '-', uniqueString(parameters('aksResourceId')))]" |
| 430 | + "[Concat('aks-monitoring-msi-dcra', '-', uniqueString(parameters('aksResourceId')))]", |
| 431 | + "[Concat('aks-monitoring-msi-dcea-config', '-', uniqueString(parameters('aksResourceId')))]" |
280 | 432 | ], |
281 | 433 | "properties": { |
282 | 434 | "mode": "Incremental", |
|
356 | 508 | }, |
357 | 509 | "streams": { |
358 | 510 | "value": "[parameters('streams')]" |
| 511 | + }, |
| 512 | + "useAzureMonitorPrivateLinkScope": { |
| 513 | + "value": "[parameters('useAzureMonitorPrivateLinkScope')]" |
| 514 | + }, |
| 515 | + "azureMonitorPrivateLinkScopeResourceId": { |
| 516 | + "value": "[parameters('azureMonitorPrivateLinkScopeResourceId')]" |
359 | 517 | } |
360 | 518 | } |
361 | 519 | } |
|
0 commit comments