provider/azurerm: Fix crash when importing Local Network Gateway (#9198)
This commit is contained in:
parent
469b9a2d23
commit
48f749cb28
|
@ -101,6 +101,9 @@ func resourceArmLocalNetworkGatewayRead(d *schema.ResourceData, meta interface{}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
name := id.Path["localNetworkGateways"]
|
name := id.Path["localNetworkGateways"]
|
||||||
|
if name == "" {
|
||||||
|
return fmt.Errorf("Cannot find 'localNetworkGateways' in '%s', make sure it is specified in the ID parameter", d.Id())
|
||||||
|
}
|
||||||
resGroup := id.ResourceGroup
|
resGroup := id.ResourceGroup
|
||||||
|
|
||||||
resp, err := lnetClient.Get(resGroup, name)
|
resp, err := lnetClient.Get(resGroup, name)
|
||||||
|
|
|
@ -52,5 +52,5 @@ The following attributes are exported:
|
||||||
Local Network Gateways can be imported using the `resource id`, e.g.
|
Local Network Gateways can be imported using the `resource id`, e.g.
|
||||||
|
|
||||||
```
|
```
|
||||||
terraform import azurerm_local_network_gateway.lng1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.network/localnetworkgateways/lng1
|
terraform import azurerm_local_network_gateway.lng1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/localNetworkGateways/lng1
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue