diff --git a/avm/res/compute/virtual-machine/README.md b/avm/res/compute/virtual-machine/README.md index 3302521f67..f6fc002f01 100644 --- a/avm/res/compute/virtual-machine/README.md +++ b/avm/res/compute/virtual-machine/README.md @@ -3213,7 +3213,6 @@ Specifies the OS disk. For security reasons, it is recommended to specify DiskEn | Parameter | Type | Description | | :-- | :-- | :-- | -| [`diskSizeGB`](#parameter-osdiskdisksizegb) | int | Specifies the size of an empty data disk in gigabytes. | | [`managedDisk`](#parameter-osdiskmanageddisk) | object | The managed disk parameters. | **Optional parameters** @@ -3223,15 +3222,9 @@ Specifies the OS disk. For security reasons, it is recommended to specify DiskEn | [`caching`](#parameter-osdiskcaching) | string | Specifies the caching requirements. | | [`createOption`](#parameter-osdiskcreateoption) | string | Specifies how the virtual machine should be created. | | [`deleteOption`](#parameter-osdiskdeleteoption) | string | Specifies whether data disk should be deleted or detached upon VM deletion. | +| [`diskSizeGB`](#parameter-osdiskdisksizegb) | int | Specifies the size of an empty data disk in gigabytes. | | [`name`](#parameter-osdiskname) | string | The disk name. | -### Parameter: `osDisk.diskSizeGB` - -Specifies the size of an empty data disk in gigabytes. - -- Required: Yes -- Type: int - ### Parameter: `osDisk.managedDisk` The managed disk parameters. @@ -3239,23 +3232,25 @@ The managed disk parameters. - Required: Yes - Type: object -**Required parameters** +**Optional parameters** | Parameter | Type | Description | | :-- | :-- | :-- | +| [`diskEncryptionSetResourceId`](#parameter-osdiskmanageddiskdiskencryptionsetresourceid) | string | Specifies the customer managed disk encryption set resource id for the managed disk. | | [`storageAccountType`](#parameter-osdiskmanageddiskstorageaccounttype) | string | Specifies the storage account type for the managed disk. | -**Optional parameters** +### Parameter: `osDisk.managedDisk.diskEncryptionSetResourceId` -| Parameter | Type | Description | -| :-- | :-- | :-- | -| [`diskEncryptionSetResourceId`](#parameter-osdiskmanageddiskdiskencryptionsetresourceid) | string | Specifies the customer managed disk encryption set resource id for the managed disk. | +Specifies the customer managed disk encryption set resource id for the managed disk. + +- Required: No +- Type: string ### Parameter: `osDisk.managedDisk.storageAccountType` Specifies the storage account type for the managed disk. -- Required: Yes +- Required: No - Type: string - Allowed: ```Bicep @@ -3270,13 +3265,6 @@ Specifies the storage account type for the managed disk. ] ``` -### Parameter: `osDisk.managedDisk.diskEncryptionSetResourceId` - -Specifies the customer managed disk encryption set resource id for the managed disk. - -- Required: No -- Type: string - ### Parameter: `osDisk.caching` Specifies the caching requirements. @@ -3321,6 +3309,13 @@ Specifies whether data disk should be deleted or detached upon VM deletion. ] ``` +### Parameter: `osDisk.diskSizeGB` + +Specifies the size of an empty data disk in gigabytes. + +- Required: No +- Type: int + ### Parameter: `osDisk.name` The disk name. diff --git a/avm/res/compute/virtual-machine/main.bicep b/avm/res/compute/virtual-machine/main.bicep index ce60427363..3125725bdb 100644 --- a/avm/res/compute/virtual-machine/main.bicep +++ b/avm/res/compute/virtual-machine/main.bicep @@ -1145,8 +1145,8 @@ type osDiskType = { @description('Optional. The disk name.') name: string? - @description('Required. Specifies the size of an empty data disk in gigabytes.') - diskSizeGB: int + @description('Optional. Specifies the size of an empty data disk in gigabytes.') + diskSizeGB: int? @description('Optional. Specifies how the virtual machine should be created.') createOption: 'Attach' | 'Empty' | 'FromImage'? @@ -1159,7 +1159,7 @@ type osDiskType = { @description('Required. The managed disk parameters.') managedDisk: { - @description('Required. Specifies the storage account type for the managed disk.') + @description('Optional. Specifies the storage account type for the managed disk.') storageAccountType: | 'PremiumV2_LRS' | 'Premium_LRS' @@ -1167,7 +1167,7 @@ type osDiskType = { | 'StandardSSD_LRS' | 'StandardSSD_ZRS' | 'Standard_LRS' - | 'UltraSSD_LRS' + | 'UltraSSD_LRS'? @description('Optional. Specifies the customer managed disk encryption set resource id for the managed disk.') diskEncryptionSetResourceId: string? diff --git a/avm/res/compute/virtual-machine/main.json b/avm/res/compute/virtual-machine/main.json index 202bb809dc..0f6e43482d 100644 --- a/avm/res/compute/virtual-machine/main.json +++ b/avm/res/compute/virtual-machine/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.26.54.24096", - "templateHash": "8007594709688742996" + "templateHash": "5878958605426596334" }, "name": "Virtual Machines", "description": "This module deploys a Virtual Machine with one or multiple NICs and optionally one or multiple public IPs.", @@ -139,8 +139,9 @@ }, "diskSizeGB": { "type": "int", + "nullable": true, "metadata": { - "description": "Required. Specifies the size of an empty data disk in gigabytes." + "description": "Optional. Specifies the size of an empty data disk in gigabytes." } }, "createOption": { @@ -192,8 +193,9 @@ "Standard_LRS", "UltraSSD_LRS" ], + "nullable": true, "metadata": { - "description": "Required. Specifies the storage account type for the managed disk." + "description": "Optional. Specifies the storage account type for the managed disk." } }, "diskEncryptionSetResourceId": {