From 39a317298b7cae5b3a67e5c88820d31c8e709bde Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Wed, 24 Jan 2018 14:25:25 +0100 Subject: [PATCH] SourceUri is no longer returned from the API --- azurerm/import_arm_snapshot_test.go | 14 ++++++++------ azurerm/resource_arm_snapshot.go | 11 +---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/azurerm/import_arm_snapshot_test.go b/azurerm/import_arm_snapshot_test.go index bec19ce8ec7e..a6c77d2fe5ef 100644 --- a/azurerm/import_arm_snapshot_test.go +++ b/azurerm/import_arm_snapshot_test.go @@ -21,9 +21,10 @@ func TestAccAzureRMSnapshot_import(t *testing.T) { Config: config, }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"source_uri"}, }, }, }) @@ -44,9 +45,10 @@ func TestAccAzureRMSnapshot_importEncryption(t *testing.T) { Config: config, }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"source_uri"}, }, }, }) diff --git a/azurerm/resource_arm_snapshot.go b/azurerm/resource_arm_snapshot.go index 423dd4365a59..83adbf913539 100644 --- a/azurerm/resource_arm_snapshot.go +++ b/azurerm/resource_arm_snapshot.go @@ -46,13 +46,12 @@ func resourceArmSnapshot() *schema.Resource { "source_uri": { Type: schema.TypeString, Optional: true, - Computed: true, + ForceNew: true, }, "source_resource_id": { Type: schema.TypeString, Optional: true, - Computed: true, ForceNew: true, }, @@ -173,14 +172,6 @@ func resourceArmSnapshotRead(d *schema.ResourceData, meta interface{}) error { if data := props.CreationData; data != nil { d.Set("create_option", string(data.CreateOption)) - if uri := data.SourceURI; uri != nil { - d.Set("source_uri", uri) - } - - if resourceId := data.SourceResourceID; resourceId != nil { - d.Set("source_resource_id", resourceId) - } - if accountId := data.StorageAccountID; accountId != nil { d.Set("storage_account_id", accountId) }