Skip to content

Commit

Permalink
azurerm_subnet_network_security_group_association fix potential dea…
Browse files Browse the repository at this point in the history
…dlock when using multiple association resources. (#12267)
  • Loading branch information
kon-angelo authored Jul 15, 2021
1 parent 463c365 commit d53c064
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ func resourceSubnetNetworkSecurityGroupAssociationCreate(d *pluginsdk.ResourceDa
virtualNetworkName := parsedSubnetId.Path["virtualNetworks"]
resourceGroup := parsedSubnetId.ResourceGroup

locks.ByName(subnetName, SubnetResourceName)
defer locks.UnlockByName(subnetName, SubnetResourceName)

locks.ByName(virtualNetworkName, VirtualNetworkResourceName)
defer locks.UnlockByName(virtualNetworkName, VirtualNetworkResourceName)

locks.ByName(subnetName, SubnetResourceName)
defer locks.UnlockByName(subnetName, SubnetResourceName)

subnet, err := client.Get(ctx, resourceGroup, virtualNetworkName, subnetName, "")
if err != nil {
if utils.ResponseWasNotFound(subnet.Response) {
Expand Down

0 comments on commit d53c064

Please sign in to comment.