From 646a39a147af1ba9456013960a13fbdf89f1a334 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Tue, 30 Aug 2022 21:37:57 +0200 Subject: [PATCH 01/12] [Modules] Updated ContainerService/ManagedClusters to new dependency approach --- .../ms.containerservice.managedclusters.yml | 3 +- .../.test/azure.parameters.json | 123 -------------- .../.test/azure/dependencies.bicep | 117 ++++++++++++++ .../.test/azure/deploy.test.bicep | 153 ++++++++++++++++++ .../.test/kubenet.parameters.json | 116 ------------- .../.test/kubenet/dependencies.bicep | 16 ++ .../.test/kubenet/deploy.test.bicep | 147 +++++++++++++++++ .../managedClusters/agentPools/deploy.bicep | 4 +- .../managedClusters/agentPools/readme.md | 2 +- .../managedClusters/deploy.bicep | 4 +- .../managedClusters/readme.md | 82 +++++----- utilities/tools/Set-ModuleReadMe.ps1 | 6 +- 12 files changed, 483 insertions(+), 290 deletions(-) delete mode 100644 modules/Microsoft.ContainerService/managedClusters/.test/azure.parameters.json create mode 100644 modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep create mode 100644 modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep delete mode 100644 modules/Microsoft.ContainerService/managedClusters/.test/kubenet.parameters.json create mode 100644 modules/Microsoft.ContainerService/managedClusters/.test/kubenet/dependencies.bicep create mode 100644 modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep diff --git a/.github/workflows/ms.containerservice.managedclusters.yml b/.github/workflows/ms.containerservice.managedclusters.yml index 3773128665..7b6d046566 100644 --- a/.github/workflows/ms.containerservice.managedclusters.yml +++ b/.github/workflows/ms.containerservice.managedclusters.yml @@ -106,8 +106,7 @@ jobs: - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' uses: ./.github/actions/templates/validateModuleDeployment with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - parameterFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' + templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' location: '${{ env.location }}' resourceGroupName: '${{ env.resourceGroupName }}' subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure.parameters.json b/modules/Microsoft.ContainerService/managedClusters/.test/azure.parameters.json deleted file mode 100644 index 327780a374..0000000000 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure.parameters.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-aks-azure-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "diskEncryptionSetID": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/diskEncryptionSets/adp-<>-az-des-x-001" - }, - "primaryAgentPoolProfile": { - "value": [ - { - "name": "systempool", - "osDiskSizeGB": 0, - "count": 1, - "enableAutoScaling": true, - "minCount": 1, - "maxCount": 3, - "vmSize": "Standard_DS2_v2", - "osType": "Linux", - "storageProfile": "ManagedDisks", - "type": "VirtualMachineScaleSets", - "mode": "System", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Primary", - "serviceCidr": "", - "maxPods": 30, - "availabilityZones": [ - "1" - ] - } - ] - }, - "aksClusterNetworkPlugin": { - "value": "azure" - }, - "agentPools": { - "value": [ - { - "name": "userpool1", - "vmSize": "Standard_DS2_v2", - "osDiskSizeGB": 128, - "count": 2, - "osType": "Linux", - "maxCount": 3, - "minCount": 1, - "enableAutoScaling": true, - "scaleSetPriority": "Regular", - "scaleSetEvictionPolicy": "Delete", - "nodeLabels": {}, - "nodeTaints": [ - "CriticalAddonsOnly=true:NoSchedule" - ], - "type": "VirtualMachineScaleSets", - "availabilityZones": [ - "1" - ], - "minPods": 2, - "maxPods": 30, - "storageProfile": "ManagedDisks", - "mode": "User", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Secondary" - }, - { - "name": "userpool2", - "vmSize": "Standard_DS2_v2", - "osDiskSizeGB": 128, - "count": 2, - "osType": "Linux", - "maxCount": 3, - "minCount": 1, - "enableAutoScaling": true, - "scaleSetPriority": "Regular", - "scaleSetEvictionPolicy": "Delete", - "nodeLabels": {}, - "nodeTaints": [ - "CriticalAddonsOnly=true:NoSchedule" - ], - "type": "VirtualMachineScaleSets", - "availabilityZones": [ - "1" - ], - "minPods": 2, - "maxPods": 30, - "storageProfile": "ManagedDisks", - "mode": "User", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Tertiary" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - } - } -} diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep new file mode 100644 index 0000000000..c0d987c093 --- /dev/null +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep @@ -0,0 +1,117 @@ +@description('Optional. The location to deploy resources to.') +param location string = resourceGroup().location + +@description('Required. The name of the Virtual Network to create.') +param virtualNetworkName string + +@description('Required. The name of the Managed Identity to create.') +param managedIdentityName string + +@description('Required. The name of the Disk Encryption Set to create.') +param diskEncryptionSetName string + +@description('Required. The name of the Key Vault to create.') +param keyVaultName string + +resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { + name: virtualNetworkName + location: location + properties: { + addressSpace: { + addressPrefixes: [ + '10.1.0.0/22' + ] + } + subnets: [ + { + name: 'systemSubnet' + properties: { + addressPrefix: '10.1.0.0/24' + } + } + { + name: 'userSubnet1' + properties: { + addressPrefix: '10.1.1.0/24' + } + } + { + name: 'userSubnet2' + properties: { + addressPrefix: '10.1.2.0/24' + } + } + ] + } +} + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { + name: keyVaultName + location: location + properties: { + sku: { + family: 'A' + name: 'standard' + } + tenantId: tenant().tenantId + enablePurgeProtection: null + enabledForTemplateDeployment: true + enabledForDiskEncryption: true + enabledForDeployment: true + enableRbacAuthorization: true + accessPolicies: [] + } + + resource key 'keys@2022-07-01' = { + name: 'encryptionKey' + properties: { + kty: 'RSA' + } + } +} + +resource diskEncryptionSet 'Microsoft.Compute/diskEncryptionSets@2021-04-01' = { + name: diskEncryptionSetName + location: location + identity: { + type: 'SystemAssigned' + } + properties: { + activeKey: { + sourceVault: { + id: keyVault.id + } + keyUrl: keyVault::key.properties.keyUriWithVersion + } + encryptionType: 'EncryptionAtRestWithCustomerKey' + } +} + +resource keyPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('msi-${managedIdentityName}-KeyVault-Key-Read-RoleAssignment') + scope: keyVault + properties: { + principalId: diskEncryptionSet.identity.principalId + // Key Vault Crypto Service Encryption User + roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'e147488a-f6f5-4113-8e2d-b22465e65bf6') + principalType: 'ServicePrincipal' + } +} + +@description('The resource ID of the created Virtual Network Subnet.') +output subnetResourceIds array = [ + virtualNetwork.properties.subnets[0].id + virtualNetwork.properties.subnets[1].id + virtualNetwork.properties.subnets[2].id +] + +@description('The principal ID of the created Managed Identity.') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId + +@description('The resource ID of the created Disk Encryption Set.') +output diskEncryptionSetResourceId string = diskEncryptionSet.id diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep new file mode 100644 index 0000000000..1f76f72e7b --- /dev/null +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep @@ -0,0 +1,153 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(80) +param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceShort}-rg' + +@description('Optional. The location to deploy resources to') +param location string = deployment().location + +@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +param serviceShort string = 'csma' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +module resourceGroupResources 'dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-paramNested' + params: { + virtualNetworkName: 'dep-<>-vnet-${serviceShort}' + managedIdentityName: 'dep-<>-msi-${serviceShort}' + diskEncryptionSetName: 'dep-<>-des-${serviceShort}' + keyVaultName: 'dep-<>-kv-${serviceShort}' + } +} + +// Diagnostics +// =========== +module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnostic.dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-diagnosticDependencies' + params: { + storageAccountName: 'dep<>diasa${serviceShort}01' + logAnalyticsWorkspaceName: 'dep-<>-law-${serviceShort}' + eventHubNamespaceEventHubName: 'dep-<>-evh-${serviceShort}' + eventHubNamespaceName: 'dep-<>-evhns-${serviceShort}' + location: location + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + primaryAgentPoolProfile: [ + { + availabilityZones: [ + '1' + ] + count: 1 + enableAutoScaling: true + maxCount: 3 + maxPods: 30 + minCount: 1 + mode: 'System' + name: 'systempool' + osDiskSizeGB: 0 + osType: 'Linux' + serviceCidr: '' + storageProfile: 'ManagedDisks' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' + vnetSubnetID: resourceGroupResources.outputs.subnetResourceIds[0] + } + ] + // Non-required parameters + agentPools: [ + { + availabilityZones: [ + '1' + ] + count: 2 + enableAutoScaling: true + maxCount: 3 + maxPods: 30 + minCount: 1 + minPods: 2 + mode: 'User' + name: 'userpool1' + nodeLabels: {} + nodeTaints: [ + 'CriticalAddonsOnly=true:NoSchedule' + ] + osDiskSizeGB: 128 + osType: 'Linux' + scaleSetEvictionPolicy: 'Delete' + scaleSetPriority: 'Regular' + storageProfile: 'ManagedDisks' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' + vnetSubnetID: resourceGroupResources.outputs.subnetResourceIds[1] + } + { + availabilityZones: [ + '1' + ] + count: 2 + enableAutoScaling: true + maxCount: 3 + maxPods: 30 + minCount: 1 + minPods: 2 + mode: 'User' + name: 'userpool2' + nodeLabels: {} + nodeTaints: [ + 'CriticalAddonsOnly=true:NoSchedule' + ] + osDiskSizeGB: 128 + osType: 'Linux' + scaleSetEvictionPolicy: 'Delete' + scaleSetPriority: 'Regular' + storageProfile: 'ManagedDisks' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' + vnetSubnetID: resourceGroupResources.outputs.subnetResourceIds[2] + } + ] + aksClusterNetworkPlugin: 'azure' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId + diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId + diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId + diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName + diskEncryptionSetID: resourceGroupResources.outputs.diskEncryptionSetResourceId + lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: true + } +} diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet.parameters.json b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet.parameters.json deleted file mode 100644 index 3e274f46ca..0000000000 --- a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet.parameters.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-aks-kubenet-001" - }, - "primaryAgentPoolProfile": { - "value": [ - { - "name": "systempool", - "osDiskSizeGB": 0, - "count": 1, - "enableAutoScaling": true, - "minCount": 1, - "maxCount": 3, - "vmSize": "Standard_DS2_v2", - "osType": "Linux", - "storageProfile": "ManagedDisks", - "type": "VirtualMachineScaleSets", - "mode": "System", - "serviceCidr": "", - "maxPods": 30, - "availabilityZones": [ - "1" - ] - } - ] - }, - "aksClusterNetworkPlugin": { - "value": "kubenet" - }, - "agentPools": { - "value": [ - { - "name": "userpool1", - "vmSize": "Standard_DS2_v2", - "osDiskSizeGB": 128, - "count": 2, - "osType": "Linux", - "maxCount": 3, - "minCount": 1, - "enableAutoScaling": true, - "scaleSetPriority": "Regular", - "scaleSetEvictionPolicy": "Delete", - "nodeLabels": {}, - "nodeTaints": [ - "CriticalAddonsOnly=true:NoSchedule" - ], - "type": "VirtualMachineScaleSets", - "availabilityZones": [ - "1" - ], - "minPods": 2, - "maxPods": 30, - "storageProfile": "ManagedDisks", - "mode": "User" - }, - { - "name": "userpool2", - "vmSize": "Standard_DS2_v2", - "osDiskSizeGB": 128, - "count": 2, - "osType": "Linux", - "maxCount": 3, - "minCount": 1, - "enableAutoScaling": true, - "scaleSetPriority": "Regular", - "scaleSetEvictionPolicy": "Delete", - "nodeLabels": {}, - "nodeTaints": [ - "CriticalAddonsOnly=true:NoSchedule" - ], - "type": "VirtualMachineScaleSets", - "availabilityZones": [ - "1" - ], - "minPods": 2, - "maxPods": 30, - "storageProfile": "ManagedDisks", - "mode": "User" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - } - } -} diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/dependencies.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/dependencies.bicep new file mode 100644 index 0000000000..cc8645d745 --- /dev/null +++ b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/dependencies.bicep @@ -0,0 +1,16 @@ +@description('Optional. The location to deploy resources to.') +param location string = resourceGroup().location + +@description('Required. The name of the Managed Identity to create.') +param managedIdentityName string + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +@description('The principal ID of the created Managed Identity.') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId + +@description('The resource ID of the created Managed Identity.') +output managedIdentityResourceId string = managedIdentity.id diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep new file mode 100644 index 0000000000..3a7d33ef88 --- /dev/null +++ b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep @@ -0,0 +1,147 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(80) +param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceShort}-rg' + +@description('Optional. The location to deploy resources to') +param location string = deployment().location + +@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +param serviceShort string = 'csmk' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +module resourceGroupResources 'dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-paramNested' + params: { + managedIdentityName: 'dep-<>-msi-${serviceShort}' + } +} + +// Diagnostics +// =========== +module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnostic.dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-diagnosticDependencies' + params: { + storageAccountName: 'dep<>diasa${serviceShort}01' + logAnalyticsWorkspaceName: 'dep-<>-law-${serviceShort}' + eventHubNamespaceEventHubName: 'dep-<>-evh-${serviceShort}' + eventHubNamespaceName: 'dep-<>-evhns-${serviceShort}' + location: location + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + primaryAgentPoolProfile: [ + { + availabilityZones: [ + '1' + ] + count: 1 + enableAutoScaling: true + maxCount: 3 + maxPods: 30 + minCount: 1 + mode: 'System' + name: 'systempool' + osDiskSizeGB: 0 + osType: 'Linux' + serviceCidr: '' + storageProfile: 'ManagedDisks' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' + } + ] + // Non-required parameters + agentPools: [ + { + availabilityZones: [ + '1' + ] + count: 2 + enableAutoScaling: true + maxCount: 3 + maxPods: 30 + minCount: 1 + minPods: 2 + mode: 'User' + name: 'userpool1' + nodeLabels: {} + nodeTaints: [ + 'CriticalAddonsOnly=true:NoSchedule' + ] + osDiskSizeGB: 128 + osType: 'Linux' + scaleSetEvictionPolicy: 'Delete' + scaleSetPriority: 'Regular' + storageProfile: 'ManagedDisks' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' + } + { + availabilityZones: [ + '1' + ] + count: 2 + enableAutoScaling: true + maxCount: 3 + maxPods: 30 + minCount: 1 + minPods: 2 + mode: 'User' + name: 'userpool2' + nodeLabels: {} + nodeTaints: [ + 'CriticalAddonsOnly=true:NoSchedule' + ] + osDiskSizeGB: 128 + osType: 'Linux' + scaleSetEvictionPolicy: 'Delete' + scaleSetPriority: 'Regular' + storageProfile: 'ManagedDisks' + type: 'VirtualMachineScaleSets' + vmSize: 'Standard_DS2_v2' + } + ] + aksClusterNetworkPlugin: 'kubenet' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId + diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId + diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId + diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] + userAssignedIdentities: { + '${resourceGroupResources.outputs.managedIdentityResourceId}': {} + } + } +} diff --git a/modules/Microsoft.ContainerService/managedClusters/agentPools/deploy.bicep b/modules/Microsoft.ContainerService/managedClusters/agentPools/deploy.bicep index 66127c2b07..86b7c009ac 100644 --- a/modules/Microsoft.ContainerService/managedClusters/agentPools/deploy.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/agentPools/deploy.bicep @@ -187,11 +187,11 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena } } -resource managedCluster 'Microsoft.ContainerService/managedClusters@2021-08-01' existing = { +resource managedCluster 'Microsoft.ContainerService/managedClusters@2022-06-01' existing = { name: managedClusterName } -resource agentPool 'Microsoft.ContainerService/managedClusters/agentPools@2021-08-01' = { +resource agentPool 'Microsoft.ContainerService/managedClusters/agentPools@2022-06-01' = { name: name parent: managedCluster properties: { diff --git a/modules/Microsoft.ContainerService/managedClusters/agentPools/readme.md b/modules/Microsoft.ContainerService/managedClusters/agentPools/readme.md index 7defa13609..e3961dda9b 100644 --- a/modules/Microsoft.ContainerService/managedClusters/agentPools/readme.md +++ b/modules/Microsoft.ContainerService/managedClusters/agentPools/readme.md @@ -13,7 +13,7 @@ This module deploys an Agent Pool for a Container Service Managed Cluster | Resource Type | API Version | | :-- | :-- | -| `Microsoft.ContainerService/managedClusters/agentPools` | [2021-08-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2021-08-01/managedClusters/agentPools) | +| `Microsoft.ContainerService/managedClusters/agentPools` | [2022-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2022-06-01/managedClusters/agentPools) | ## Parameters diff --git a/modules/Microsoft.ContainerService/managedClusters/deploy.bicep b/modules/Microsoft.ContainerService/managedClusters/deploy.bicep index dfb5edc731..e54235b227 100644 --- a/modules/Microsoft.ContainerService/managedClusters/deploy.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/deploy.bicep @@ -286,7 +286,7 @@ param lock string = '' @description('Optional. Tags of the resource.') param tags object = {} -@description('Optional. The resource ID of the disc encryption set to apply to the clsuter. For security reasons, this value should be provided.') +@description('Optional. The resource ID of the disc encryption set to apply to the cluster. For security reasons, this value should be provided.') param diskEncryptionSetID string = '' @description('Optional. The name of logs that will be streamed.') @@ -378,7 +378,7 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena } } -resource managedCluster 'Microsoft.ContainerService/managedClusters@2022-04-02-preview' = { +resource managedCluster 'Microsoft.ContainerService/managedClusters@2022-06-01' = { name: name location: location tags: tags diff --git a/modules/Microsoft.ContainerService/managedClusters/readme.md b/modules/Microsoft.ContainerService/managedClusters/readme.md index 264253da80..16d71cc174 100644 --- a/modules/Microsoft.ContainerService/managedClusters/readme.md +++ b/modules/Microsoft.ContainerService/managedClusters/readme.md @@ -16,8 +16,8 @@ This module deploys Azure Kubernetes Cluster (AKS). | :-- | :-- | | `Microsoft.Authorization/locks` | [2017-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2017-04-01/locks) | | `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) | -| `Microsoft.ContainerService/managedClusters` | [2022-04-02-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2022-04-02-preview/managedClusters) | -| `Microsoft.ContainerService/managedClusters/agentPools` | [2021-08-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2021-08-01/managedClusters/agentPools) | +| `Microsoft.ContainerService/managedClusters` | [2022-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2022-06-01/managedClusters) | +| `Microsoft.ContainerService/managedClusters/agentPools` | [2022-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2022-06-01/managedClusters/agentPools) | | `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) | ## Parameters @@ -89,7 +89,7 @@ This module deploys Azure Kubernetes Cluster (AKS). | `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. | | `disableLocalAccounts` | bool | `False` | | If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. | | `disableRunCommand` | bool | `False` | | Whether to disable run command for the cluster or not. | -| `diskEncryptionSetID` | string | `''` | | The resource ID of the disc encryption set to apply to the clsuter. For security reasons, this value should be provided. | +| `diskEncryptionSetID` | string | `''` | | The resource ID of the disc encryption set to apply to the cluster. For security reasons, this value should be provided. | | `enableAzureDefender` | bool | `False` | | Whether to enable Azure Defender. | | `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via the Customer Usage Attribution ID (GUID). | | `enableKeyvaultSecretsProvider` | bool | `False` | | Specifies whether the KeyvaultSecretsProvider add-on is enabled or not. | @@ -375,11 +375,11 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-managedClusters' +module Managedclusters './Microsoft.Containerservice/Managedclusters/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-csma' params: { // Required parameters - name: '<>-az-aks-azure-001' + name: '<>csma001' primaryAgentPoolProfile: [ { availabilityZones: [ @@ -398,7 +398,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice storageProfile: 'ManagedDisks' type: 'VirtualMachineScaleSets' vmSize: 'Standard_DS2_v2' - vnetSubnetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Primary' + vnetSubnetID: '' } ] // Non-required parameters @@ -426,7 +426,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice storageProfile: 'ManagedDisks' type: 'VirtualMachineScaleSets' vmSize: 'Standard_DS2_v2' - vnetSubnetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Secondary' + vnetSubnetID: '' } { availabilityZones: [ @@ -451,21 +451,21 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice storageProfile: 'ManagedDisks' type: 'VirtualMachineScaleSets' vmSize: 'Standard_DS2_v2' - vnetSubnetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Tertiary' + vnetSubnetID: '' } ] aksClusterNetworkPlugin: 'azure' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticEventHubAuthorizationRuleId: '' + diagnosticEventHubName: '' diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' - diskEncryptionSetID: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/diskEncryptionSets/adp-<>-az-des-x-001' + diagnosticStorageAccountId: '' + diagnosticWorkspaceId: '' + diskEncryptionSetID: '' lock: 'CanNotDelete' roleAssignments: [ { principalIds: [ - '<>' + '' ] roleDefinitionIdOrName: 'Reader' } @@ -489,7 +489,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice "parameters": { // Required parameters "name": { - "value": "<>-az-aks-azure-001" + "value": "<>csma001" }, "primaryAgentPoolProfile": { "value": [ @@ -510,7 +510,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice "storageProfile": "ManagedDisks", "type": "VirtualMachineScaleSets", "vmSize": "Standard_DS2_v2", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Primary" + "vnetSubnetID": "" } ] }, @@ -540,7 +540,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice "storageProfile": "ManagedDisks", "type": "VirtualMachineScaleSets", "vmSize": "Standard_DS2_v2", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Secondary" + "vnetSubnetID": "" }, { "availabilityZones": [ @@ -565,7 +565,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice "storageProfile": "ManagedDisks", "type": "VirtualMachineScaleSets", "vmSize": "Standard_DS2_v2", - "vnetSubnetID": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-aks/subnets/Tertiary" + "vnetSubnetID": "" } ] }, @@ -573,22 +573,22 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice "value": "azure" }, "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + "value": "" }, "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "value": "" }, "diagnosticLogsRetentionInDays": { "value": 7 }, "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + "value": "" }, "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + "value": "" }, "diskEncryptionSetID": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/diskEncryptionSets/adp-<>-az-des-x-001" + "value": "" }, "lock": { "value": "CanNotDelete" @@ -597,7 +597,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice "value": [ { "principalIds": [ - "<>" + "" ], "roleDefinitionIdOrName": "Reader" } @@ -620,11 +620,11 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice via Bicep module ```bicep -module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-managedClusters' +module Managedclusters './Microsoft.Containerservice/Managedclusters/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-csmk' params: { // Required parameters - name: '<>-az-aks-kubenet-001' + name: '<>csmk001' primaryAgentPoolProfile: [ { availabilityZones: [ @@ -697,21 +697,21 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice } ] aksClusterNetworkPlugin: 'kubenet' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticEventHubAuthorizationRuleId: '' + diagnosticEventHubName: '' diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + diagnosticStorageAccountId: '' + diagnosticWorkspaceId: '' roleAssignments: [ { principalIds: [ - '<>' + '' ] roleDefinitionIdOrName: 'Reader' } ] userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + '': {} } } } @@ -731,7 +731,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice "parameters": { // Required parameters "name": { - "value": "<>-az-aks-kubenet-001" + "value": "<>csmk001" }, "primaryAgentPoolProfile": { "value": [ @@ -812,25 +812,25 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice "value": "kubenet" }, "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + "value": "" }, "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "value": "" }, "diagnosticLogsRetentionInDays": { "value": 7 }, "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + "value": "" }, "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + "value": "" }, "roleAssignments": { "value": [ { "principalIds": [ - "<>" + "" ], "roleDefinitionIdOrName": "Reader" } @@ -838,7 +838,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice }, "userAssignedIdentities": { "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + "": {} } } } diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index a1074fed21..6b922d65e8 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -883,9 +883,10 @@ function Set-DeploymentExamplesSection { '' ) + $TextInfo = (Get-Culture -Name 'en-US').TextInfo $moduleRoot = Split-Path $TemplateFilePath -Parent - $resourceTypeIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') - $resourceType = $resourceTypeIdentifier.Split('/')[1] + $resourceTypeIdentifier = $TextInfo.ToTitleCase($moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/')) + $resourceType = $TextInfo.ToTitleCase($resourceTypeIdentifier.Split('/')[1]) $testFilePaths = Get-ModuleTestFileList -ModulePath $moduleRoot | ForEach-Object { Join-Path $moduleRoot $_ } $RequiredParametersList = $TemplateFileContent.parameters.Keys | Where-Object { $TemplateFileContent.parameters[$_].Keys -notcontains 'defaultValue' } | Sort-Object @@ -906,7 +907,6 @@ function Set-DeploymentExamplesSection { } else { $exampleTitle = ((Split-Path $testFilePath -LeafBase) -replace '\.', ' ') -replace ' parameters', '' } - $TextInfo = (Get-Culture -Name 'en-US').TextInfo $exampleTitle = $TextInfo.ToTitleCase($exampleTitle) $SectionContent += @( '

Example {0}: {1}

' -f $pathIndex, $exampleTitle From 494f03273229e4ef363cb2632b152ae5634ed382 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 11:34:24 +0200 Subject: [PATCH 02/12] Update to latest --- .../Microsoft.ContainerService/managedClusters/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/readme.md b/modules/Microsoft.ContainerService/managedClusters/readme.md index e91bb77923..497b0b73ed 100644 --- a/modules/Microsoft.ContainerService/managedClusters/readme.md +++ b/modules/Microsoft.ContainerService/managedClusters/readme.md @@ -375,8 +375,8 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-ManagedClusters' +module ManagedClusters './Microsoft.ContainerService/ManagedClusters/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-csma' params: { // Required parameters name: '<>csma001' @@ -620,8 +620,8 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice via Bicep module ```bicep -module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-ManagedClusters' +module ManagedClusters './Microsoft.ContainerService/ManagedClusters/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-csmk' params: { // Required parameters name: '<>csmk001' From 0231fb4d33766a3b5084b5cfa82b40d7964e2877 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 12:32:09 +0200 Subject: [PATCH 03/12] Update to latest --- .../managedClusters/.test/azure/dependencies.bicep | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep index c0d987c093..36a473509a 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep @@ -93,12 +93,11 @@ resource diskEncryptionSet 'Microsoft.Compute/diskEncryptionSets@2021-04-01' = { } resource keyPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('msi-${managedIdentityName}-KeyVault-Key-Read-RoleAssignment') + name: guid('msi-${keyVault.id}-${location}-${managedIdentity.id}-KeyVault-Key-Read-RoleAssignment') scope: keyVault properties: { principalId: diskEncryptionSet.identity.principalId - // Key Vault Crypto Service Encryption User - roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'e147488a-f6f5-4113-8e2d-b22465e65bf6') + roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'e147488a-f6f5-4113-8e2d-b22465e65bf6') // Key Vault Crypto Service Encryption User principalType: 'ServicePrincipal' } } From d2d87e213fa81787723e53543c6f7fdd1ea86698 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:50:25 +0200 Subject: [PATCH 04/12] Update to latest --- .../managedClusters/.test/azure/deploy.test.bicep | 2 +- .../managedClusters/.test/kubenet/deploy.test.bicep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep index 1f76f72e7b..ee2d858a1b 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceS @description('Optional. The location to deploy resources to') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') param serviceShort string = 'csma' // =========== // diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep index 3a7d33ef88..be125db47f 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceS @description('Optional. The location to deploy resources to') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') param serviceShort string = 'csmk' // =========== // From 78ffbdd5e33ee6ce12661e36f26cb6b04074ff2b Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:03:24 +0200 Subject: [PATCH 05/12] Update to latest --- .../managedClusters/.test/azure/deploy.test.bicep | 6 +++--- .../managedClusters/.test/kubenet/deploy.test.bicep | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep index ee2d858a1b..a6189c62cf 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for a testing purposes.') @maxLength(80) param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceShort}-rg' -@description('Optional. The location to deploy resources to') +@description('Optional. The location to deploy resources to.') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') param serviceShort string = 'csma' // =========== // diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep index be125db47f..e2e19c155f 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for a testing purposes.') @maxLength(80) param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceShort}-rg' -@description('Optional. The location to deploy resources to') +@description('Optional. The location to deploy resources to.') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') param serviceShort string = 'csmk' // =========== // From aa3ee10c3b2377c81ba7235ca31faacb70e58082 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:42:10 +0200 Subject: [PATCH 06/12] Update to latest --- modules/Microsoft.ContainerService/managedClusters/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/readme.md b/modules/Microsoft.ContainerService/managedClusters/readme.md index 4fa0c10cc3..93aa9716ee 100644 --- a/modules/Microsoft.ContainerService/managedClusters/readme.md +++ b/modules/Microsoft.ContainerService/managedClusters/readme.md @@ -377,7 +377,7 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module ManagedClusters './Microsoft.ContainerService/ManagedClusters/deploy.bicep' = { +module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-csma' params: { // Required parameters @@ -622,7 +622,7 @@ module ManagedClusters './Microsoft.ContainerService/ManagedClusters/deploy.bice via Bicep module ```bicep -module ManagedClusters './Microsoft.ContainerService/ManagedClusters/deploy.bicep' = { +module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-csmk' params: { // Required parameters From 4a743f988b7213abc76045903d8c510a9c5e7864 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 20:17:30 +0200 Subject: [PATCH 07/12] Apply suggestions from code review --- .../managedClusters/.test/azure/deploy.test.bicep | 2 +- .../managedClusters/.test/kubenet/deploy.test.bicep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep index a6189c62cf..5f118761a4 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes.') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(80) param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceShort}-rg' diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep index e2e19c155f..c1d1e737e0 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes.') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(80) param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceShort}-rg' From 5e854b60534bafaab15e28f75bee3d3bc4c91aac Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 19 Sep 2022 20:18:19 +0200 Subject: [PATCH 08/12] Update to latest --- utilities/tools/Set-ModuleReadMe.ps1 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index 6469605289..25923c3d62 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -896,13 +896,6 @@ function Set-DeploymentExamplesSection { '' ) -<<<<<<< HEAD - $TextInfo = (Get-Culture -Name 'en-US').TextInfo - $moduleRoot = Split-Path $TemplateFilePath -Parent - $fullIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') - -======= ->>>>>>> main # Get resource type and make first letter upper case. Requires manual handling as ToTitleCase lowercases everything but the first letter $providerNamespace = ($fullModuleIdentifier.Split('/')[0] -split '\.' | ForEach-Object { $_.Substring(0, 1).ToUpper() + $_.Substring(1) }) -join '.' $resourceType = $fullModuleIdentifier.Split('/')[1] From 4e3ffb68e0973a73010c9087cafe898f4a0e10ff Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 10:19:47 +0200 Subject: [PATCH 09/12] Update modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../managedClusters/.test/azure/deploy.test.bicep | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep index 5f118761a4..a6ce9b7b76 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep @@ -79,7 +79,6 @@ module testDeployment '../../deploy.bicep' = { vnetSubnetID: resourceGroupResources.outputs.subnetResourceIds[0] } ] - // Non-required parameters agentPools: [ { availabilityZones: [ From a3c43ebc121e300e5d9935c79ddc253539262329 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 10:19:52 +0200 Subject: [PATCH 10/12] Update modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../managedClusters/.test/kubenet/deploy.test.bicep | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep index c1d1e737e0..31f7bdfa90 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep @@ -75,7 +75,6 @@ module testDeployment '../../deploy.bicep' = { vmSize: 'Standard_DS2_v2' } ] - // Non-required parameters agentPools: [ { availabilityZones: [ From 4be22eec65c1dd3563ec7d912baf408dc730cfd4 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 10:20:09 +0200 Subject: [PATCH 11/12] Update modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../managedClusters/.test/azure/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep index a6ce9b7b76..95204bc1f1 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceS param location string = deployment().location @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') -param serviceShort string = 'csma' +param serviceShort string = 'csmazure' // =========== // // Deployments // From 2694b2e9076eafad34eb5b51d208e18dac70a3a8 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 10:20:21 +0200 Subject: [PATCH 12/12] Update modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../managedClusters/.test/kubenet/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep index 31f7bdfa90..bcefb01a43 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/kubenet/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.containerservice.managedclusters-${serviceS param location string = deployment().location @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') -param serviceShort string = 'csmk' +param serviceShort string = 'csmkube' // =========== // // Deployments //