Skip to content

Commit

Permalink
azurerm_dev_test_lab: remove deprecated attribute (#27224)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaweitao001 authored Aug 30, 2024
1 parent 182814e commit 4563450
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
Expand Down
26 changes: 0 additions & 26 deletions internal/services/devtestlabs/dev_test_lab_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ 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"
"github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/labs"
"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"
)
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4563450

Please sign in to comment.