Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module testDeployment '../../deploy.bicep' = {
enableDefaultTelemetry: enableDefaultTelemetry
name: '<<namePrefix>>${serviceShort}001'
lock: 'CanNotDelete'
proximityPlacementGroupId: nestedDependencies.outputs.proximityPlacementGroupResourceId
proximityPlacementGroupResourceId: nestedDependencies.outputs.proximityPlacementGroupResourceId
roleAssignments: [
{
roleDefinitionIdOrName: 'Reader'
Expand Down
18 changes: 9 additions & 9 deletions modules/Microsoft.Compute/availabilitySets/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
param name string

@description('Optional. The number of fault domains to use.')
param availabilitySetFaultDomain int = 2
param platformFaultDomainCount int = 2

@description('Optional. The number of update domains to use.')
param availabilitySetUpdateDomain int = 5
param platformUpdateDomainCount int = 5

@description('''Optional. SKU of the availability set.
- Use \'Aligned\' for virtual machines with managed disks.
- Use \'Classic\' for virtual machines with unmanaged disks.
''')
param availabilitySetSku string = 'Aligned'
param skuName string = 'Aligned'

@description('Optional. Resource ID of a proximity placement group.')
param proximityPlacementGroupId string = ''
param proximityPlacementGroupResourceId string = ''

@description('Optional. Resource location.')
param location string = resourceGroup().location
Expand Down Expand Up @@ -53,14 +53,14 @@ resource availabilitySet 'Microsoft.Compute/availabilitySets@2022-11-01' = {
location: location
tags: tags
properties: {
platformFaultDomainCount: availabilitySetFaultDomain
platformUpdateDomainCount: availabilitySetUpdateDomain
proximityPlacementGroup: !empty(proximityPlacementGroupId) ? {
id: proximityPlacementGroupId
platformFaultDomainCount: platformFaultDomainCount
platformUpdateDomainCount: platformUpdateDomainCount
proximityPlacementGroup: !empty(proximityPlacementGroupResourceId) ? {
id: proximityPlacementGroupResourceId
} : null
}
sku: {
name: availabilitySetSku
name: skuName
}
}

Expand Down
14 changes: 7 additions & 7 deletions modules/Microsoft.Compute/availabilitySets/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ This template deploys an availability set

| Parameter Name | Type | Default Value | Allowed Values | Description |
| :-- | :-- | :-- | :-- | :-- |
| `availabilitySetFaultDomain` | int | `2` | | The number of fault domains to use. |
| `availabilitySetSku` | string | `'Aligned'` | | SKU of the availability set.<p>- Use \'Aligned\' for virtual machines with managed disks.<p>- Use \'Classic\' for virtual machines with unmanaged disks.<p> |
| `availabilitySetUpdateDomain` | int | `5` | | The number of update domains to use. |
| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
| `location` | string | `[resourceGroup().location]` | | Resource location. |
| `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. |
| `proximityPlacementGroupId` | string | `''` | | Resource ID of a proximity placement group. |
| `platformFaultDomainCount` | int | `2` | | The number of fault domains to use. |
| `platformUpdateDomainCount` | int | `5` | | The number of update domains to use. |
| `proximityPlacementGroupResourceId` | string | `''` | | Resource ID of a proximity placement group. |
| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
| `skuName` | string | `'Aligned'` | | SKU of the availability set.<p>- Use \'Aligned\' for virtual machines with managed disks.<p>- Use \'Classic\' for virtual machines with unmanaged disks.<p> |
| `tags` | object | `{object}` | | Tags of the availability set resource. |


Expand Down Expand Up @@ -176,7 +176,7 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {
// Non-required parameters
enableDefaultTelemetry: '<enableDefaultTelemetry>'
lock: 'CanNotDelete'
proximityPlacementGroupId: '<proximityPlacementGroupId>'
proximityPlacementGroupResourceId: '<proximityPlacementGroupResourceId>'
roleAssignments: [
{
principalIds: [
Expand Down Expand Up @@ -217,8 +217,8 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {
"lock": {
"value": "CanNotDelete"
},
"proximityPlacementGroupId": {
"value": "<proximityPlacementGroupId>"
"proximityPlacementGroupResourceId": {
"value": "<proximityPlacementGroupResourceId>"
},
"roleAssignments": {
"value": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ param diskEncryptionSetName string
@description('Required. The name of the Key Vault to create.')
param keyVaultName string

@description('Required. The name of the Proximity Placement Group to create.')
param proximityPlacementGroupName string

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-09-01' = {
name: virtualNetworkName
location: location
Expand Down Expand Up @@ -103,6 +106,11 @@ resource keyPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
}
}

resource proximityPlacementGroup 'Microsoft.Compute/proximityPlacementGroups@2022-03-01' = {
name: proximityPlacementGroupName
location: location
}

@description('The resource ID of the created Virtual Network Subnet.')
output subnetResourceIds array = [
virtualNetwork.properties.subnets[0].id
Expand All @@ -115,3 +123,6 @@ output managedIdentityPrincipalId string = managedIdentity.properties.principalI

@description('The resource ID of the created Disk Encryption Set.')
output diskEncryptionSetResourceId string = diskEncryptionSet.id

@description('The resource ID of the created Proximity Placement Group.')
output proximityPlacementGroupResourceId string = proximityPlacementGroup.id
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module nestedDependencies 'dependencies.bicep' = {
virtualNetworkName: 'dep-<<namePrefix>>-vnet-${serviceShort}'
managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}'
diskEncryptionSetName: 'dep-<<namePrefix>>-des-${serviceShort}'
proximityPlacementGroupName: 'dep-<<namePrefix>>-ppg-${serviceShort}'
// Adding base time to make the name unique as purge protection must be enabled (but may not be longer than 24 characters total)
keyVaultName: 'dep-<<namePrefix>>-kv-${serviceShort}-${substring(uniqueString(baseTime), 0, 3)}'
}
Expand Down Expand Up @@ -113,6 +114,7 @@ module testDeployment '../../deploy.bicep' = {
type: 'VirtualMachineScaleSets'
vmSize: 'Standard_DS2_v2'
vnetSubnetID: nestedDependencies.outputs.subnetResourceIds[1]
proximityPlacementGroupResourceId: nestedDependencies.outputs.proximityPlacementGroupResourceId
}
{
availabilityZones: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@description('Conditional. The name of the parent managed cluster. Required if the template is used in a standalone deployment.')
@minLength(1)
param managedClusterName string

@description('Required. Name of the agent pool.')
Expand Down Expand Up @@ -99,7 +98,7 @@ param osType string = 'Linux'
param podSubnetId string = ''

@description('Optional. The ID for the Proximity Placement Group.')
param proximityPlacementGroupId string = ''
param proximityPlacementGroupResourceId string = ''

@description('Optional. Describes how VMs are added to or removed from Agent Pools. See billing states (https://learn.microsoft.com/en-us/azure/virtual-machines/states-billing).')
@allowed([
Expand Down Expand Up @@ -198,7 +197,7 @@ resource agentPool 'Microsoft.ContainerService/managedClusters/agentPools@2022-1
osSKU: !empty(osSku) ? any(osSku) : null
osType: osType
podSubnetID: !empty(podSubnetId) ? podSubnetId : null
proximityPlacementGroupID: !empty(proximityPlacementGroupId) ? proximityPlacementGroupId : null
proximityPlacementGroupID: !empty(proximityPlacementGroupResourceId) ? proximityPlacementGroupResourceId : null
scaleDownMode: scaleDownMode
scaleSetEvictionPolicy: scaleSetEvictionPolicy
scaleSetPriority: !empty(scaleSetPriority) ? any(scaleSetPriority) : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This module deploys an Agent Pool for a Container Service Managed Cluster
| `osSku` | string | `''` | `['', CBLMariner, Ubuntu]` | Specifies an OS SKU. This value must not be specified if OSType is Windows. |
| `osType` | string | `'Linux'` | `[Linux, Windows]` | The operating system type. The default is Linux. |
| `podSubnetId` | string | `''` | | Subnet ID for the pod IPs. If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. |
| `proximityPlacementGroupId` | string | `''` | | The ID for the Proximity Placement Group. |
| `proximityPlacementGroupResourceId` | string | `''` | | The ID for the Proximity Placement Group. |
| `scaleDownMode` | string | `'Delete'` | `[Deallocate, Delete]` | Describes how VMs are added to or removed from Agent Pools. See billing states (https://learn.microsoft.com/en-us/azure/virtual-machines/states-billing). |
| `scaleSetEvictionPolicy` | string | `'Delete'` | `[Deallocate, Delete]` | The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see spot VMs. |
| `scaleSetPriority` | string | `''` | `['', Regular, Spot]` | The Virtual Machine Scale Set priority. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ module managedCluster_agentPools 'agentPools/deploy.bicep' = [for (agentPool, in
osSku: contains(agentPool, 'osSku') ? agentPool.osSku : ''
osType: contains(agentPool, 'osType') ? agentPool.osType : 'Linux'
podSubnetId: contains(agentPool, 'podSubnetId') ? agentPool.podSubnetId : ''
proximityPlacementGroupId: contains(agentPool, 'proximityPlacementGroupId') ? agentPool.proximityPlacementGroupId : ''
proximityPlacementGroupResourceId: contains(agentPool, 'proximityPlacementGroupResourceId') ? agentPool.proximityPlacementGroupResourceId : ''
scaleDownMode: contains(agentPool, 'scaleDownMode') ? agentPool.scaleDownMode : 'Delete'
scaleSetEvictionPolicy: contains(agentPool, 'scaleSetEvictionPolicy') ? agentPool.scaleSetEvictionPolicy : 'Delete'
scaleSetPriority: contains(agentPool, 'scaleSetPriority') ? agentPool.scaleSetPriority : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice
]
osDiskSizeGB: 128
osType: 'Linux'
proximityPlacementGroupResourceId: '<proximityPlacementGroupResourceId>'
scaleSetEvictionPolicy: 'Delete'
scaleSetPriority: 'Regular'
storageProfile: 'ManagedDisks'
Expand Down Expand Up @@ -614,6 +615,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice
],
"osDiskSizeGB": 128,
"osType": "Linux",
"proximityPlacementGroupResourceId": "<proximityPlacementGroupResourceId>",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Regular",
"storageProfile": "ManagedDisks",
Expand Down