Skip to content

Commit

Permalink
Fix: osDisk required properties for diskSizeGB and storageAccountType (
Browse files Browse the repository at this point in the history
…#2616)

Fix:

- #2082
  • Loading branch information
rahalan authored Jul 3, 2024
1 parent c0a0874 commit 6bfef3b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
37 changes: 16 additions & 21 deletions avm/res/compute/virtual-machine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand All @@ -3223,39 +3222,35 @@ 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.

- 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
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions avm/res/compute/virtual-machine/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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'?
Expand All @@ -1159,15 +1159,15 @@ 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'
| 'Premium_ZRS'
| '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?
Expand Down
8 changes: 5 additions & 3 deletions avm/res/compute/virtual-machine/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 6bfef3b

Please sign in to comment.