Skip to content

azurermLocalNetworkGateway

Manages a local network gateway connection over which specific connections can be configured.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "localNetworkGWTest",
  }
);
new azurerm.localNetworkGateway.LocalNetworkGateway(this, "home", {
  address_space: ["10.0.0.0/16"],
  gateway_address: "12.13.14.15",
  location: azurermResourceGroupExample.location,
  name: "backHome",
  resource_group_name: azurermResourceGroupExample.name,
});

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the local network gateway. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.

  • location - (Required) The location/region where the local network gateway is created. Changing this forces a new resource to be created.

  • addressSpace - (Optional) The list of string CIDRs representing the address spaces the gateway exposes.

  • bgpSettings - (Optional) A bgpSettings block as defined below containing the Local Network Gateway's BGP speaker settings.

  • gatewayAddress - (Optional) The gateway IP address to connect with.

  • gatewayFqdn - (Optional) The gateway FQDN to connect with.

-> NOTE: Either gatewayAddress or gatewayFqdn should be specified.

  • tags - (Optional) A mapping of tags to assign to the resource.

The bgpSettings block supports the following:

  • asn - (Required) The BGP speaker's ASN.

  • bgpPeeringAddress - (Required) The BGP peering address and BGP identifier of this BGP speaker.

  • peerWeight - (Optional) The weight added to routes learned from this BGP speaker.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Local Network Gateway.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Local Network Gateway.
  • update - (Defaults to 30 minutes) Used when updating the Local Network Gateway.
  • read - (Defaults to 5 minutes) Used when retrieving the Local Network Gateway.
  • delete - (Defaults to 30 minutes) Used when deleting the Local Network Gateway.

Import

Local Network Gateways can be imported using the resourceId, e.g.

terraform import azurerm_local_network_gateway.lng1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/localNetworkGateways/lng1