From 4563450e05c08ff45a471a242094826ac6b63269 Mon Sep 17 00:00:00 2001 From: JT <100274846+jiaweitao001@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:25:01 +0800 Subject: [PATCH] azurerm_dev_test_lab: remove deprecated attribute (#27224) --- .../dev_test_lab_data_source_test.go | 2 +- .../devtestlabs/dev_test_lab_resource.go | 26 ------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/internal/services/devtestlabs/dev_test_lab_data_source_test.go b/internal/services/devtestlabs/dev_test_lab_data_source_test.go index 8f06c57b9253..7ff41e6b19ee 100644 --- a/internal/services/devtestlabs/dev_test_lab_data_source_test.go +++ b/internal/services/devtestlabs/dev_test_lab_data_source_test.go @@ -36,7 +36,7 @@ func TestAccDevTestLabDataSource_complete(t *testing.T) { { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).Key("storage_type").HasValue("Standard"), + check.That(data.ResourceName).Key("storage_type").HasValue("Premium"), check.That(data.ResourceName).Key("tags.%").HasValue("1"), check.That(data.ResourceName).Key("tags.Hello").HasValue("World"), ), diff --git a/internal/services/devtestlabs/dev_test_lab_resource.go b/internal/services/devtestlabs/dev_test_lab_resource.go index ce4b0f5b6517..599215e36d57 100644 --- a/internal/services/devtestlabs/dev_test_lab_resource.go +++ b/internal/services/devtestlabs/dev_test_lab_resource.go @@ -8,7 +8,6 @@ import ( "log" "time" - "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -16,12 +15,10 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/devtestlabs/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/devtestlabs/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -97,19 +94,6 @@ func resourceDevTestLab() *pluginsdk.Resource { }, } - if !features.FourPointOhBeta() { - resource.Schema["storage_type"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Optional: true, - Default: string(labs.StorageTypePremium), - ValidateFunc: validation.StringInSlice([]string{ - string(labs.StorageTypeStandard), - string(labs.StorageTypePremium), - }, false), - Deprecated: "`storage_type` is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0.", - } - } - return resource } @@ -143,13 +127,6 @@ func resourceDevTestLabCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) Tags: expandTags(d.Get("tags").(map[string]interface{})), } - if !features.FourPointOhBeta() { - storageType := labs.StorageType(d.Get("storage_type").(string)) - parameters.Properties = &labs.LabProperties{ - LabStorageType: &storageType, - } - } - err := client.CreateOrUpdateThenPoll(ctx, id, parameters) if err != nil { return fmt.Errorf("creating/updating %s: %+v", id, err) @@ -190,9 +167,6 @@ func resourceDevTestLabRead(d *pluginsdk.ResourceData, meta interface{}) error { } if props := model.Properties; props != nil { - if !features.FourPointOhBeta() { - d.Set("storage_type", string(pointer.From(props.LabStorageType))) - } // Computed fields d.Set("artifacts_storage_account_id", props.ArtifactsStorageAccount) d.Set("default_storage_account_id", props.DefaultStorageAccount)