Skip to content

Commit 4cdb597

Browse files
committed
Documentation and tests
1 parent b49ec9c commit 4cdb597

4 files changed

Lines changed: 31 additions & 5 deletions

File tree

.web-docs/components/builder/arm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Providing `temp_resource_group_name` or `location` in combination with
290290
learn more about managed images.
291291

292292
- `managed_image_storage_account_type` (string) - Specify the storage account
293-
type for a managed image. Valid values are Standard_LRS and Premium_LRS.
293+
type for a managed image. Valid values are Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS,StandardSSD_ZRS and PremiumV2_LRS.
294294
The default is Standard_LRS.
295295

296296
- `managed_image_os_disk_snapshot_name` (string) - If

builder/azure/arm/config.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ type SharedImageGalleryDestination struct {
119119
// See the `shared_image_gallery_destination` block description for an example of using this field
120120
SigDestinationTargetRegions []TargetRegion `mapstructure:"target_region"`
121121
// Specify a storage account type for the Shared Image Gallery Image Version.
122-
// Defaults to `Standard_LRS`. Accepted values are `Standard_LRS`, `Standard_ZRS` and `Premium_LRS`
122+
// Defaults to `Standard_LRS`. Accepted values are `Standard_LRS`, `Standard_ZRS` and `Premium_LRS`, `PremiumV2_LRS`,
123+
// `StandardSSD_LRS`, `StandardSSD_ZRS`, `UltraSSD_LRS`
123124
SigDestinationStorageAccountType string `mapstructure:"storage_account_type"`
124125
// Set to true if publishing to a Specialized Gallery, this skips a call to set the build VM's OS state as Generalized
125126
SigDestinationSpecialized bool `mapstructure:"specialized"`
@@ -1552,6 +1553,14 @@ func assertRequiredParametersSet(c *Config, errs *packersdk.MultiError) {
15521553
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesStandardLRS
15531554
case string(virtualmachines.StorageAccountTypesPremiumLRS):
15541555
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesPremiumLRS
1556+
case string(virtualmachines.StorageAccountTypesPremiumVTwoLRS):
1557+
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesPremiumVTwoLRS
1558+
case string(virtualmachines.StorageAccountTypesStandardSSDLRS):
1559+
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesStandardSSDLRS
1560+
case string(virtualmachines.StorageAccountTypesStandardSSDZRS):
1561+
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesStandardSSDZRS
1562+
case string(virtualmachines.StorageAccountTypesUltraSSDLRS):
1563+
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesUltraSSDLRS
15551564
default:
15561565
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("The managed_image_storage_account_type %q is invalid", c.ManagedImageStorageAccountType))
15571566
}

builder/azure/dtl/config.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ type Config struct {
210210
// learn more about managed images.
211211
ManagedImageName string `mapstructure:"managed_image_name" required:"true"`
212212
// Specify the storage account
213-
// type for a managed image. Valid values are Standard_LRS and Premium_LRS.
214-
// The default is Standard_LRS.
213+
// type for a managed image. Valid values are Standard_LRS, Premium_LRS,
214+
// StandardSSD_LRS, StandardSSD_ZRS, PremiumV2_LRS, PremiumV2_ZRS, UltraSSD_LRS
215+
// The default is Standard_LRS.'
215216
ManagedImageStorageAccountType string `mapstructure:"managed_image_storage_account_type" required:"false"`
216217
managedImageStorageAccountType virtualmachines.StorageAccountTypes
217218

@@ -747,6 +748,14 @@ func assertRequiredParametersSet(c *Config, errs *packersdk.MultiError) {
747748
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesStandardLRS
748749
case string(images.StorageAccountTypesPremiumLRS):
749750
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesPremiumLRS
751+
case string(images.StorageAccountTypesPremiumVTwoLRS):
752+
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesPremiumVTwoLRS
753+
case string(images.StorageAccountTypesStandardSSDLRS):
754+
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesStandardSSDLRS
755+
case string(images.StorageAccountTypesStandardSSDZRS):
756+
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesStandardSSDZRS
757+
case string(images.StorageAccountTypesUltraSSDLRS):
758+
c.managedImageStorageAccountType = virtualmachines.StorageAccountTypesUltraSSDLRS
750759
default:
751760
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("The managed_image_storage_account_type %q is invalid", c.ManagedImageStorageAccountType))
752761
}

builder/azure/dtl/config_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,15 @@ func TestConfigShouldAcceptManagedImageStorageAccountTypes(t *testing.T) {
409409
"os_type": constants.Target_Linux,
410410
}
411411

412-
storage_account_types := []string{"Premium_LRS", "Standard_LRS"}
412+
storage_account_types := []string{
413+
"Premium_LRS",
414+
"PremiumV2_LRS",
415+
"Premium_ZRS",
416+
"Standard_LRS",
417+
"StandardSSD_LRS",
418+
"StandardSSD_ZRS",
419+
"UltraSSD_LRS",
420+
}
413421

414422
for _, x := range storage_account_types {
415423
config_map["managed_image_storage_account_type"] = x

0 commit comments

Comments
 (0)