Skip to content

Commit

Permalink
azurerm_network_interface_security_group_association remove itself …
Browse files Browse the repository at this point in the history
…when NIC not found (hashicorp#7459)

Fix: hashicorp#7041
  • Loading branch information
yupwei68 authored and jrauschenbusch committed Jun 25, 2020
1 parent f7fccb6 commit 72e4dd0
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -82,7 +82,9 @@ func resourceArmNetworkInterfaceApplicationSecurityGroupAssociationCreate(d *sch
read, err := client.Get(ctx, resourceGroup, networkInterfaceName, "")
if err != nil {
if utils.ResponseWasNotFound(read.Response) {
return fmt.Errorf("Network Interface %q (Resource Group %q) was not found!", networkInterfaceName, resourceGroup)
log.Printf("[INFO] Network Interface %q does not exist - removing from state", d.Id())
d.SetId("")
return nil
}

return fmt.Errorf("Error retrieving Network Interface %q (Resource Group %q): %+v", networkInterfaceName, resourceGroup, err)
Expand Down

0 comments on commit 72e4dd0

Please sign in to comment.