diff --git a/azurerm/internal/services/compute/linux_virtual_machine_scale_set_other_resource_test.go b/azurerm/internal/services/compute/linux_virtual_machine_scale_set_other_resource_test.go index 26acff68582c2..ea214aa131936 100644 --- a/azurerm/internal/services/compute/linux_virtual_machine_scale_set_other_resource_test.go +++ b/azurerm/internal/services/compute/linux_virtual_machine_scale_set_other_resource_test.go @@ -507,8 +507,7 @@ func TestAccLinuxVirtualMachineScaleSet_otherEncryptionAtHost(t *testing.T) { check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), }) } @@ -523,24 +522,21 @@ func TestAccLinuxVirtualMachineScaleSet_otherEncryptionAtHostUpdate(t *testing.T check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), { Config: r.otherEncryptionAtHost(data, false), Check: resource.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), { Config: r.otherEncryptionAtHost(data, true), Check: resource.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), }) } @@ -555,8 +551,7 @@ func TestAccLinuxVirtualMachineScaleSet_otherEncryptionAtHostWithCMK(t *testing. check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), }) } @@ -571,8 +566,7 @@ func TestAccLinuxVirtualMachineScaleSet_otherPlatformFaultDomainCount(t *testing check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), }) } diff --git a/azurerm/internal/services/compute/linux_virtual_machine_scale_set_resource.go b/azurerm/internal/services/compute/linux_virtual_machine_scale_set_resource.go index eead2ddac6fd8..c3df5166b1d3e 100644 --- a/azurerm/internal/services/compute/linux_virtual_machine_scale_set_resource.go +++ b/azurerm/internal/services/compute/linux_virtual_machine_scale_set_resource.go @@ -417,7 +417,7 @@ func resourceLinuxVirtualMachineScaleSetCreate(d *schema.ResourceData, meta inte hasHealthExtension := false if vmExtensionsRaw, ok := d.GetOk("extension"); ok { - virtualMachineProfile.ExtensionProfile, hasHealthExtension, err = expandVirtualMachineScaleSetExtensions(vmExtensionsRaw.([]interface{})) + virtualMachineProfile.ExtensionProfile, hasHealthExtension, err = expandVirtualMachineScaleSetExtensions(vmExtensionsRaw.(*schema.Set).List()) if err != nil { return err } @@ -824,7 +824,7 @@ func resourceLinuxVirtualMachineScaleSetUpdate(d *schema.ResourceData, meta inte if d.HasChanges("extension", "extensions_time_budget") { updateInstances = true - extensionProfile, _, err := expandVirtualMachineScaleSetExtensions(d.Get("extension").([]interface{})) + extensionProfile, _, err := expandVirtualMachineScaleSetExtensions(d.Get("extension").(*schema.Set).List()) if err != nil { return err } diff --git a/azurerm/internal/services/compute/virtual_machine_scale_set.go b/azurerm/internal/services/compute/virtual_machine_scale_set.go index a33a54e507eb4..3b36cf319e3a5 100644 --- a/azurerm/internal/services/compute/virtual_machine_scale_set.go +++ b/azurerm/internal/services/compute/virtual_machine_scale_set.go @@ -1494,7 +1494,7 @@ func FlattenVirtualMachineScaleSetAutomaticRepairsPolicy(input *compute.Automati func VirtualMachineScaleSetExtensionsSchema() *schema.Schema { return &schema.Schema{ - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Computed: true, Elem: &schema.Resource{ diff --git a/azurerm/internal/services/compute/windows_virtual_machine_scale_set_other_resource_test.go b/azurerm/internal/services/compute/windows_virtual_machine_scale_set_other_resource_test.go index b76f18404c3e3..3e09cd30b6202 100644 --- a/azurerm/internal/services/compute/windows_virtual_machine_scale_set_other_resource_test.go +++ b/azurerm/internal/services/compute/windows_virtual_machine_scale_set_other_resource_test.go @@ -613,8 +613,7 @@ func TestAccWindowsVirtualMachineScaleSet_otherEncryptionAtHostEnabled(t *testin check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), }) } @@ -629,24 +628,21 @@ func TestAccWindowsVirtualMachineScaleSet_otherEncryptionAtHostEnabledUpdate(t * check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), { Config: r.otherEncryptionAtHostEnabled(data, false), Check: resource.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), { Config: r.otherEncryptionAtHostEnabled(data, true), Check: resource.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), }) } @@ -661,8 +657,7 @@ func TestAccWindowsVirtualMachineScaleSet_otherEncryptionAtHostEnabledWithCMK(t check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), }) } @@ -677,8 +672,7 @@ func TestAccWindowsVirtualMachineScaleSet_otherPlatformFaultDomainCount(t *testi check.That(data.ResourceName).ExistsInAzure(r), ), }, - // TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta - data.ImportStep("admin_password", "extension"), + data.ImportStep("admin_password", "extension.0.protected_settings"), }) } diff --git a/azurerm/internal/services/compute/windows_virtual_machine_scale_set_resource.go b/azurerm/internal/services/compute/windows_virtual_machine_scale_set_resource.go index e5b04ea320a09..84025e84cb64e 100644 --- a/azurerm/internal/services/compute/windows_virtual_machine_scale_set_resource.go +++ b/azurerm/internal/services/compute/windows_virtual_machine_scale_set_resource.go @@ -433,7 +433,7 @@ func resourceWindowsVirtualMachineScaleSetCreate(d *schema.ResourceData, meta in hasHealthExtension := false if vmExtensionsRaw, ok := d.GetOk("extension"); ok { - virtualMachineProfile.ExtensionProfile, hasHealthExtension, err = expandVirtualMachineScaleSetExtensions(vmExtensionsRaw.([]interface{})) + virtualMachineProfile.ExtensionProfile, hasHealthExtension, err = expandVirtualMachineScaleSetExtensions(vmExtensionsRaw.(*schema.Set).List()) if err != nil { return err } @@ -851,7 +851,7 @@ func resourceWindowsVirtualMachineScaleSetUpdate(d *schema.ResourceData, meta in if d.HasChanges("extension", "extensions_time_budget") { updateInstances = true - extensionProfile, _, err := expandVirtualMachineScaleSetExtensions(d.Get("extension").([]interface{})) + extensionProfile, _, err := expandVirtualMachineScaleSetExtensions(d.Get("extension").(*schema.Set).List()) if err != nil { return err }