From b248ab8fdb8d129ff34562bf03393f6901e326c1 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Mon, 16 Nov 2020 20:29:45 +0100 Subject: [PATCH] storage: fixing changes since the shim layer was merged --- .../resource_arm_storage_data_lake_gen2_path.go | 14 ++++++++++---- ...esource_arm_storage_data_lake_gen2_path_test.go | 6 +++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/azurerm/internal/services/storage/resource_arm_storage_data_lake_gen2_path.go b/azurerm/internal/services/storage/resource_arm_storage_data_lake_gen2_path.go index 6ffaa4df9762..36f62c3ea50c 100644 --- a/azurerm/internal/services/storage/resource_arm_storage_data_lake_gen2_path.go +++ b/azurerm/internal/services/storage/resource_arm_storage_data_lake_gen2_path.go @@ -11,7 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/parsers" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" "github.com/tombuildsstuff/giovanni/storage/2019-12-12/datalakestore/paths" @@ -65,7 +66,12 @@ func resourceArmStorageDataLakeGen2Path() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "storage_account_id": AccountIDSchema(), + "storage_account_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.StorageAccountID, + }, "filesystem_name": { Type: schema.TypeString, @@ -141,7 +147,7 @@ func resourceArmStorageDataLakeGen2PathCreate(d *schema.ResourceData, meta inter ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() - storageID, err := parsers.ParseAccountID(d.Get("storage_account_id").(string)) + storageID, err := parse.ParseAccountID(d.Get("storage_account_id").(string)) if err != nil { return err } @@ -235,7 +241,7 @@ func resourceArmStorageDataLakeGen2PathUpdate(d *schema.ResourceData, meta inter return err } - storageID, err := parsers.ParseAccountID(d.Get("storage_account_id").(string)) + storageID, err := parse.ParseAccountID(d.Get("storage_account_id").(string)) if err != nil { return err } diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_data_lake_gen2_path_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_data_lake_gen2_path_test.go index 5e3975839de0..a778228cae18 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_data_lake_gen2_path_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_data_lake_gen2_path_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/parsers" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" "github.com/tombuildsstuff/giovanni/storage/2019-12-12/datalakestore/paths" ) @@ -145,7 +145,7 @@ func testCheckAzureRMStorageDataLakeGen2PathExists(resourceName string) resource fileSystemName := rs.Primary.Attributes["filesystem_name"] path := rs.Primary.Attributes["path"] - storageID, err := parsers.ParseAccountID(rs.Primary.Attributes["storage_account_id"]) + storageID, err := parse.ParseAccountID(rs.Primary.Attributes["storage_account_id"]) if err != nil { return err } @@ -174,7 +174,7 @@ func testCheckAzureRMStorageDataLakeGen2PathDestroy(s *terraform.State) error { fileSystemName := rs.Primary.Attributes["filesystem_name"] path := rs.Primary.Attributes["path"] - storageID, err := parsers.ParseAccountID(rs.Primary.Attributes["storage_account_id"]) + storageID, err := parse.ParseAccountID(rs.Primary.Attributes["storage_account_id"]) if err != nil { return err }