Skip to content

Commit

Permalink
r/storage_account_network_rules: switching to use the networkruleset …
Browse files Browse the repository at this point in the history
…from props
  • Loading branch information
tombuildsstuff committed Feb 13, 2020
1 parent cc2fabb commit 1f633af
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,15 @@ func resourceArmStorageAccountNetworkRulesCreateUpdate(d *schema.ResourceData, m
return fmt.Errorf("Storage Account %q (Resource Group %q) was not found", storageAccountName, resourceGroup)
}

return fmt.Errorf("Error loading Storage Account %q (Resource Group %q): %+v", storageAccountName, resourceGroup, err)
return fmt.Errorf("Error retrieving Storage Account %q (Resource Group %q): %+v", storageAccountName, resourceGroup, err)
}

if features.ShouldResourcesBeImported() {
if checkForNonDefaultStorageAccountNetworkRule(storageAccount.NetworkRuleSet) {
if storageAccount.AccountProperties == nil {
return fmt.Errorf("Error retrieving Storage Account %q (Resource Group %q): `properties` was nil", storageAccountName, resourceGroup)
}

if checkForNonDefaultStorageAccountNetworkRule(storageAccount.AccountProperties.NetworkRuleSet) {
return tf.ImportAsExistsError("azurerm_storage_account_network_rule", *storageAccount.ID)
}
}
Expand Down

0 comments on commit 1f633af

Please sign in to comment.